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/gfx/display.h" |
20 #include "ui/gfx/image/image_skia.h" | 20 #include "ui/gfx/image/image_skia.h" |
21 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
22 | 22 |
23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
24 #include "base/win/metro.h" | |
25 #include "ui/gfx/win/dpi.h" | 24 #include "ui/gfx/win/dpi.h" |
26 #include <Windows.h> | 25 #include <Windows.h> |
27 #endif // defined(OS_WIN) | 26 #endif // defined(OS_WIN) |
28 | 27 |
29 namespace ui { | 28 namespace ui { |
30 | 29 |
31 namespace { | 30 namespace { |
32 | 31 |
33 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; | 32 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; |
34 | 33 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 128 |
130 #if !defined(OS_MACOSX) | 129 #if !defined(OS_MACOSX) |
131 float GetScaleFactorForNativeView(gfx::NativeView view) { | 130 float GetScaleFactorForNativeView(gfx::NativeView view) { |
132 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 131 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); |
133 gfx::Display display = screen->GetDisplayNearestWindow(view); | 132 gfx::Display display = screen->GetDisplayNearestWindow(view); |
134 return display.device_scale_factor(); | 133 return display.device_scale_factor(); |
135 } | 134 } |
136 #endif // !defined(OS_MACOSX) | 135 #endif // !defined(OS_MACOSX) |
137 | 136 |
138 } // namespace ui | 137 } // namespace ui |
OLD | NEW |