| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 delete g_supported_scale_factors; | 100 delete g_supported_scale_factors; |
| 101 g_supported_scale_factors = NULL; | 101 g_supported_scale_factors = NULL; |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace test | 105 } // namespace test |
| 106 | 106 |
| 107 #if !defined(OS_MACOSX) | 107 #if !defined(OS_MACOSX) |
| 108 float GetScaleFactorForNativeView(gfx::NativeView view) { | 108 float GetScaleFactorForNativeView(gfx::NativeView view) { |
| 109 display::Display display = | 109 display::Display display = |
| 110 display::Screen::GetScreen()->GetDisplayNearestWindow(view); | 110 display::Screen::GetScreen()->GetDisplayNearestView(view); |
| 111 DCHECK(display.is_valid()); | 111 DCHECK(display.is_valid()); |
| 112 return display.device_scale_factor(); | 112 return display.device_scale_factor(); |
| 113 } | 113 } |
| 114 #endif // !defined(OS_MACOSX) | 114 #endif // !defined(OS_MACOSX) |
| 115 | 115 |
| 116 } // namespace ui | 116 } // namespace ui |
| OLD | NEW |