| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |