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

Side by Side Diff: ash/display/display_info.cc

Issue 271543009: Send the device scale factor from Windows 8 ASH during initialization via the MetroViewerHostMsg_Se… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed tabs Created 6 years, 7 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
« no previous file with comments | « no previous file | ash/test/test_metro_viewer_process_host.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/display/display_info.h" 9 #include "ash/display/display_info.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 int x = 0, y = 0, width, height; 108 int x = 0, y = 0, width, height;
109 float device_scale_factor = 1.0f; 109 float device_scale_factor = 1.0f;
110 if (sscanf(main_spec.c_str(), "%dx%d*%f", 110 if (sscanf(main_spec.c_str(), "%dx%d*%f",
111 &width, &height, &device_scale_factor) >= 2 || 111 &width, &height, &device_scale_factor) >= 2 ||
112 sscanf(main_spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height, 112 sscanf(main_spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height,
113 &device_scale_factor) >= 4) { 113 &device_scale_factor) >= 4) {
114 bounds_in_native.SetRect(x, y, width, height); 114 bounds_in_native.SetRect(x, y, width, height);
115 } else { 115 } else {
116 #if defined(OS_WIN) 116 #if defined(OS_WIN)
117 if (gfx::IsHighDPIEnabled()) { 117 if (gfx::IsHighDPIEnabled()) {
118 device_scale_factor = gfx::GetModernUIScale(); 118 device_scale_factor = gfx::GetDPIScale();
119 } 119 }
120 #endif 120 #endif
121 } 121 }
122 122
123 std::vector<DisplayMode> display_modes; 123 std::vector<DisplayMode> display_modes;
124 if (Tokenize(main_spec, "#", &parts) == 2) { 124 if (Tokenize(main_spec, "#", &parts) == 2) {
125 size_t native_mode = 0; 125 size_t native_mode = 0;
126 int largest_area = -1; 126 int largest_area = -1;
127 float highest_refresh_rate = -1.0f; 127 float highest_refresh_rate = -1.0f;
128 main_spec = parts[0]; 128 main_spec = parts[0];
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 334
335 bool DisplayInfo::IsColorProfileAvailable( 335 bool DisplayInfo::IsColorProfileAvailable(
336 ui::ColorCalibrationProfile profile) const { 336 ui::ColorCalibrationProfile profile) const {
337 return std::find(available_color_profiles_.begin(), 337 return std::find(available_color_profiles_.begin(),
338 available_color_profiles_.end(), 338 available_color_profiles_.end(),
339 profile) != available_color_profiles_.end(); 339 profile) != available_color_profiles_.end();
340 } 340 }
341 341
342 } // namespace ash 342 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/test/test_metro_viewer_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698