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

Unified Diff: remoting/host/client_session.cc

Issue 12678008: Reworked the plumbing required to pass the client resolution to the desktop resizer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index e3cfaf7aa5b80e51606b33ce94e2e8d25807f282..c1dfff228c9e3a00a7eff37265e7986eeea4ed83 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -19,6 +19,7 @@
#include "remoting/host/audio_scheduler.h"
#include "remoting/host/desktop_environment.h"
#include "remoting/host/event_executor.h"
+#include "remoting/host/screen_resolution.h"
#include "remoting/host/session_controller.h"
#include "remoting/host/video_scheduler.h"
#include "remoting/proto/control.pb.h"
@@ -96,16 +97,22 @@ ClientSession::~ClientSession() {
void ClientSession::NotifyClientResolution(
const protocol::ClientResolution& resolution) {
- if (resolution.has_dips_width() && resolution.has_dips_height()) {
- VLOG(1) << "Received ClientResolution (dips_width="
- << resolution.dips_width() << ", dips_height="
- << resolution.dips_height() << ")";
- if (session_controller_) {
- session_controller_->OnClientResolutionChanged(
- SkIPoint::Make(kDefaultDPI, kDefaultDPI),
- SkISize::Make(resolution.dips_width(), resolution.dips_height()));
- }
- }
+ if (!resolution.has_dips_width() || !resolution.has_dips_height())
+ return;
+
+ VLOG(1) << "Received ClientResolution (dips_width="
+ << resolution.dips_width() << ", dips_height="
+ << resolution.dips_height() << ")";
+
+ if (!session_controller_)
+ return;
+
+ ScreenResolution client_resolution(SkISize::Make(resolution.dips_width(),
+ resolution.dips_height()));
+
+ // Try to match the client's resolution.
+ if (client_resolution.IsValid())
+ session_controller_->SetScreenResolution(client_resolution);
}
void ClientSession::ControlVideo(const protocol::VideoControl& video_control) {

Powered by Google App Engine
This is Rietveld 408576698