Chromium Code Reviews| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 } else { | 108 } else { |
| 109 delete g_supported_scale_factors; | 109 delete g_supported_scale_factors; |
| 110 g_supported_scale_factors = NULL; | 110 g_supported_scale_factors = NULL; |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace test | 114 } // namespace test |
| 115 | 115 |
| 116 #if !defined(OS_MACOSX) | 116 #if !defined(OS_MACOSX) |
| 117 float GetScaleFactorForNativeView(gfx::NativeView view) { | 117 float GetScaleFactorForNativeView(gfx::NativeView view) { |
| 118 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 118 gfx::Screen* screen = gfx::Screen::GetScreen(); |
| 119 gfx::Display display = screen->GetDisplayNearestWindow(view); | 119 gfx::Display display = screen->GetDisplayNearestWindow(view); |
|
oshima
2016/01/19 20:44:31
single line?
scottmg
2016/01/19 21:55:57
Done.
| |
| 120 return display.device_scale_factor(); | 120 return display.device_scale_factor(); |
| 121 } | 121 } |
| 122 #endif // !defined(OS_MACOSX) | 122 #endif // !defined(OS_MACOSX) |
| 123 | 123 |
| 124 } // namespace ui | 124 } // namespace ui |
| OLD | NEW |