| 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> |
| 11 #include <limits> | 11 #include <limits> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "ui/base/touch/touch_device.h" | 17 #include "ui/base/touch/touch_device.h" |
| 18 #include "ui/base/ui_base_switches.h" | 18 #include "ui/base/ui_base_switches.h" |
| 19 #include "ui/gfx/display.h" | 19 #include "ui/display/display.h" |
| 20 #include "ui/display/screen.h" |
| 20 #include "ui/gfx/image/image_skia.h" | 21 #include "ui/gfx/image/image_skia.h" |
| 21 #include "ui/gfx/screen.h" | |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; | 27 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 void SetSupportedScaleFactors( | 31 void SetSupportedScaleFactors( |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } else { | 99 } else { |
| 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 return gfx::Screen::GetScreen() | 109 return display::Screen::GetScreen() |
| 110 ->GetDisplayNearestWindow(view) | 110 ->GetDisplayNearestWindow(view) |
| 111 .device_scale_factor(); | 111 .device_scale_factor(); |
| 112 } | 112 } |
| 113 #endif // !defined(OS_MACOSX) | 113 #endif // !defined(OS_MACOSX) |
| 114 | 114 |
| 115 } // namespace ui | 115 } // namespace ui |
| OLD | NEW |