Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: remoting/host/resizing_host_observer.cc

Issue 12220092: Rename ClientDimensions to ClientResolution and add pixel-size and DPI fields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typos in ChromotingInstance. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/resizing_host_observer.h" 5 #include "remoting/host/resizing_host_observer.h"
6 #include "remoting/host/desktop_resizer.h" 6 #include "remoting/host/desktop_resizer.h"
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // are typically designed for landscape aspect ratios. 119 // are typically designed for landscape aspect ratios.
120 return size().width() > other.size().width(); 120 return size().width() > other.size().width();
121 } 121 }
122 122
123 private: 123 private:
124 float client_scale_factor_; 124 float client_scale_factor_;
125 float aspect_ratio_goodness_; 125 float aspect_ratio_goodness_;
126 SkISize size_; 126 SkISize size_;
127 }; 127 };
128 128
129 void ResizingHostObserver::OnClientDimensionsChanged( 129 void ResizingHostObserver::OnClientResolutionChanged(
130 const std::string& jid, const SkISize& preferred_size) { 130 const std::string& jid,
131 const SkISize& preferred_size,
132 const SkIPoint& dpi) {
131 if (previous_size_.isZero() || preferred_size.isEmpty()) { 133 if (previous_size_.isZero() || preferred_size.isEmpty()) {
132 return; 134 return;
133 } 135 }
134 136
135 // If the host desktop size changes other than via the resize-to-client 137 // If the host desktop size changes other than via the resize-to-client
136 // mechanism, then set |previous_size_| to zero and give up. This is an 138 // mechanism, then set |previous_size_| to zero and give up. This is an
137 // indication that the user doesn't want resize-to-client. 139 // indication that the user doesn't want resize-to-client.
138 SkISize current_size = desktop_resizer_->GetCurrentSize(); 140 SkISize current_size = desktop_resizer_->GetCurrentSize();
139 if (current_size != previous_size_) { 141 if (current_size != previous_size_) {
140 previous_size_ = SkISize::Make(0, 0); 142 previous_size_ = SkISize::Make(0, 0);
(...skipping 14 matching lines...) Expand all
155 if (candidate_size.IsBetterThan(best_size)) { 157 if (candidate_size.IsBetterThan(best_size)) {
156 best_size = candidate_size; 158 best_size = candidate_size;
157 } 159 }
158 } 160 }
159 previous_size_ = best_size.size(); 161 previous_size_ = best_size.size();
160 if (previous_size_ != current_size) 162 if (previous_size_ != current_size)
161 desktop_resizer_->SetSize(previous_size_); 163 desktop_resizer_->SetSize(previous_size_);
162 } 164 }
163 165
164 } // namespace remoting 166 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698