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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 2021773002: Use only DIPs size in ClientResolution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <nacl_io/nacl_io.h> 7 #include <nacl_io/nacl_io.h>
8 #include <sys/mount.h> 8 #include <sys/mount.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 x_dpi <= 0 || y_dpi <= 0) { 804 x_dpi <= 0 || y_dpi <= 0) {
805 LOG(ERROR) << "Invalid notifyClientResolution."; 805 LOG(ERROR) << "Invalid notifyClientResolution.";
806 return; 806 return;
807 } 807 }
808 808
809 if (!IsConnected()) { 809 if (!IsConnected()) {
810 return; 810 return;
811 } 811 }
812 812
813 protocol::ClientResolution client_resolution; 813 protocol::ClientResolution client_resolution;
814 client_resolution.set_width(width);
815 client_resolution.set_height(height);
816 client_resolution.set_x_dpi(x_dpi); 814 client_resolution.set_x_dpi(x_dpi);
817 client_resolution.set_y_dpi(y_dpi); 815 client_resolution.set_y_dpi(y_dpi);
818
819 // Include the legacy width & height in DIPs for use by older hosts.
820 client_resolution.set_dips_width((width * kDefaultDPI) / x_dpi); 816 client_resolution.set_dips_width((width * kDefaultDPI) / x_dpi);
821 client_resolution.set_dips_height((height * kDefaultDPI) / y_dpi); 817 client_resolution.set_dips_height((height * kDefaultDPI) / y_dpi);
822 818
819 // Include the legacy width & height in physical pixels for use by older
820 // hosts.
821 client_resolution.set_width_deprecated(width);
822 client_resolution.set_height_deprecated(height);
823
823 client_->host_stub()->NotifyClientResolution(client_resolution); 824 client_->host_stub()->NotifyClientResolution(client_resolution);
824 } 825 }
825 826
826 void ChromotingInstance::HandleVideoControl(const base::DictionaryValue& data) { 827 void ChromotingInstance::HandleVideoControl(const base::DictionaryValue& data) {
827 protocol::VideoControl video_control; 828 protocol::VideoControl video_control;
828 bool pause_video = false; 829 bool pause_video = false;
829 if (data.GetBoolean("pause", &pause_video)) { 830 if (data.GetBoolean("pause", &pause_video)) {
830 video_control.set_enable(!pause_video); 831 video_control.set_enable(!pause_video);
831 perf_tracker_.OnPauseStateChanged(pause_video); 832 perf_tracker_.OnPauseStateChanged(pause_video);
832 } 833 }
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 if (is_custom_counts_histogram) { 1118 if (is_custom_counts_histogram) {
1118 uma.HistogramCustomCounts(histogram_name, value, histogram_min, 1119 uma.HistogramCustomCounts(histogram_name, value, histogram_min,
1119 histogram_max, histogram_buckets); 1120 histogram_max, histogram_buckets);
1120 } else { 1121 } else {
1121 uma.HistogramCustomTimes(histogram_name, value, histogram_min, 1122 uma.HistogramCustomTimes(histogram_name, value, histogram_min,
1122 histogram_max, histogram_buckets); 1123 histogram_max, histogram_buckets);
1123 } 1124 }
1124 } 1125 }
1125 1126
1126 } // namespace remoting 1127 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698