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

Unified Diff: remoting/client/plugin/chromoting_instance.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/chromoting_host.h » ('j') | remoting/host/client_session.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index daf591f24713f7b062053c6db3ceb180153a2b33..3ee563d810ca09457a2d16fd29f0c4f4629b877d 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -54,6 +54,10 @@ namespace {
// 32-bit BGRA is 4 bytes per pixel.
const int kBytesPerPixel = 4;
+// Default DPI to assume for old clients that use notifyClientDimensions.
+const int kDefaultDPI = 96;
+
+// Interval at which to sample performance statistics.
const int kPerfStatsIntervalMs = 1000;
// URL scheme used by Chrome apps and extensions.
@@ -593,10 +597,18 @@ void ChromotingInstance::NotifyClientDimensions(int width, int height) {
if (!IsConnected()) {
return;
}
- protocol::ClientDimensions client_dimensions;
- client_dimensions.set_width(width);
- client_dimensions.set_height(height);
- host_connection_->host_stub()->NotifyClientDimensions(client_dimensions);
+
+ protocol::ClientResolution client_resolution;
+ client_resolution.set_width(width);
+ client_resolution.set_height(height);
+ client_resolution.set_x_dpi(kDefaultDPI);
+ client_resolution.set_y_dpi(kDefaultDPI);
+
+ // Include the legacy width & height for use by older hosts.
+ client_resolution.set_dips_width(width);
+ client_resolution.set_dips_height(height);
+
+ host_connection_->host_stub()->NotifyClientResolution(client_resolution);
}
void ChromotingInstance::PauseVideo(bool pause) {
« no previous file with comments | « no previous file | remoting/host/chromoting_host.h » ('j') | remoting/host/client_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698