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

Side by Side Diff: ui/base/layout.cc

Issue 11953054: Fix high-DPI on Windows to make use of DIP scaling in WebKit. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove redundant comments. 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
« no previous file with comments | « content/port/browser/render_widget_host_view_port.h ('k') | ui/base/win/dpi.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) 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 "ui/base/layout.h" 5 #include "ui/base/layout.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (display.device_scale_factor() > 1.0) { 112 if (display.device_scale_factor() > 1.0) {
113 DCHECK_EQ(2.0, display.device_scale_factor()); 113 DCHECK_EQ(2.0, display.device_scale_factor());
114 supported_scale_factors->push_back(SCALE_FACTOR_200P); 114 supported_scale_factors->push_back(SCALE_FACTOR_200P);
115 } else { 115 } else {
116 supported_scale_factors->push_back(SCALE_FACTOR_100P); 116 supported_scale_factors->push_back(SCALE_FACTOR_100P);
117 } 117 }
118 #elif defined(OS_MACOSX) 118 #elif defined(OS_MACOSX)
119 if (base::mac::IsOSLionOrLater()) 119 if (base::mac::IsOSLionOrLater())
120 supported_scale_factors->push_back(SCALE_FACTOR_200P); 120 supported_scale_factors->push_back(SCALE_FACTOR_200P);
121 #elif defined(OS_WIN) && defined(ENABLE_HIDPI) 121 #elif defined(OS_WIN) && defined(ENABLE_HIDPI)
122 if (base::win::IsMetroProcess() && base::win::IsTouchEnabled()) { 122 if (base::win::IsMetroProcess() && ui::IsTouchDevicePresent()) {
123 supported_scale_factors->push_back(SCALE_FACTOR_140P); 123 supported_scale_factors->push_back(SCALE_FACTOR_140P);
124 supported_scale_factors->push_back(SCALE_FACTOR_180P); 124 supported_scale_factors->push_back(SCALE_FACTOR_180P);
125 } 125 }
126 #elif defined(OS_CHROMEOS) 126 #elif defined(OS_CHROMEOS)
127 // TODO(oshima): Include 200P only if the device support 200P 127 // TODO(oshima): Include 200P only if the device support 200P
128 supported_scale_factors->push_back(SCALE_FACTOR_200P); 128 supported_scale_factors->push_back(SCALE_FACTOR_200P);
129 #endif 129 #endif
130 std::sort(supported_scale_factors->begin(), 130 std::sort(supported_scale_factors->begin(),
131 supported_scale_factors->end(), 131 supported_scale_factors->end(),
132 ScaleFactorComparator); 132 ScaleFactorComparator);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); 210 gfx::Screen* screen = gfx::Screen::GetScreenFor(view);
211 if (screen->IsDIPEnabled()) { 211 if (screen->IsDIPEnabled()) {
212 gfx::Display display = screen->GetDisplayNearestWindow(view); 212 gfx::Display display = screen->GetDisplayNearestWindow(view);
213 return GetScaleFactorFromScale(display.device_scale_factor()); 213 return GetScaleFactorFromScale(display.device_scale_factor());
214 } 214 }
215 return ui::SCALE_FACTOR_100P; 215 return ui::SCALE_FACTOR_100P;
216 } 216 }
217 #endif // !defined(OS_MACOSX) 217 #endif // !defined(OS_MACOSX)
218 218
219 } // namespace ui 219 } // namespace ui
OLDNEW
« no previous file with comments | « content/port/browser/render_widget_host_view_port.h ('k') | ui/base/win/dpi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698