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> |
| 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/display/display.h" | 19 #include "ui/display/display.h" |
| 20 #include "ui/display/screen.h" | 20 #include "ui/display/screen.h" |
| 21 #include "ui/gfx/image/image_skia.h" | 21 #include "ui/gfx/image/image_skia.h" |
| 22 #include "ui/gfx/view_util.h" | |
|
tapted
2017/02/15 00:36:10
is this needed?
Jinsuk Kim
2017/02/16 10:11:25
Removed.
| |
| 22 | 23 |
| 23 namespace ui { | 24 namespace ui { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 | 27 |
| 27 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; | 28 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; |
| 28 | 29 |
| 29 } // namespace | 30 } // namespace |
| 30 | 31 |
| 31 void SetSupportedScaleFactors( | 32 void SetSupportedScaleFactors( |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 delete original_scale_factors_; | 99 delete original_scale_factors_; |
| 99 } else { | 100 } else { |
| 100 delete g_supported_scale_factors; | 101 delete g_supported_scale_factors; |
| 101 g_supported_scale_factors = NULL; | 102 g_supported_scale_factors = NULL; |
| 102 } | 103 } |
| 103 } | 104 } |
| 104 | 105 |
| 105 } // namespace test | 106 } // namespace test |
| 106 | 107 |
| 107 #if !defined(OS_MACOSX) | 108 #if !defined(OS_MACOSX) |
| 108 float GetScaleFactorForNativeView(gfx::NativeView view) { | 109 float GetScaleFactorForNativeWindow(gfx::NativeWindow window) { |
| 109 return display::Screen::GetScreen() | 110 return display::Screen::GetScreen() |
| 110 ->GetDisplayNearestWindow(view) | 111 ->GetDisplayNearestWindow(window) |
| 111 .device_scale_factor(); | 112 .device_scale_factor(); |
| 112 } | 113 } |
| 113 #endif // !defined(OS_MACOSX) | 114 #endif // !defined(OS_MACOSX) |
| 114 | 115 |
| 115 } // namespace ui | 116 } // namespace ui |
| OLD | NEW |