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

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

Issue 293563002: GetScaleFactorForNativeView should return scale factor in float (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « ui/base/layout.h ('k') | ui/base/layout_mac.mm » ('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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 delete original_scale_factors_; 137 delete original_scale_factors_;
138 } else { 138 } else {
139 delete g_supported_scale_factors; 139 delete g_supported_scale_factors;
140 g_supported_scale_factors = NULL; 140 g_supported_scale_factors = NULL;
141 } 141 }
142 } 142 }
143 143
144 } // namespace test 144 } // namespace test
145 145
146 #if !defined(OS_MACOSX) 146 #if !defined(OS_MACOSX)
147 ScaleFactor GetScaleFactorForNativeView(gfx::NativeView view) { 147 float GetScaleFactorForNativeView(gfx::NativeView view) {
148 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); 148 gfx::Screen* screen = gfx::Screen::GetScreenFor(view);
149 if (screen->IsDIPEnabled()) { 149 if (screen->IsDIPEnabled()) {
150 gfx::Display display = screen->GetDisplayNearestWindow(view); 150 gfx::Display display = screen->GetDisplayNearestWindow(view);
151 return GetSupportedScaleFactor(display.device_scale_factor()); 151 return display.device_scale_factor();
152 } 152 }
153 return ui::SCALE_FACTOR_100P; 153 return 1.0f;
154 } 154 }
155 #endif // !defined(OS_MACOSX) 155 #endif // !defined(OS_MACOSX)
156 156
157 } // namespace ui 157 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/layout.h ('k') | ui/base/layout_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698