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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "ui/base/touch/touch_device.h" | 15 #include "ui/base/touch/touch_device.h" |
16 #include "ui/base/ui_base_switches.h" | 16 #include "ui/base/ui_base_switches.h" |
17 #include "ui/gfx/display.h" | 17 #include "ui/gfx/display.h" |
18 #include "ui/gfx/screen.h" | 18 #include "ui/gfx/screen.h" |
19 | 19 |
20 #if defined(OS_MACOSX) && !defined(OS_IOS) | 20 #if defined(OS_MACOSX) && !defined(OS_IOS) |
21 #include "base/mac/mac_util.h" | 21 #include "base/mac/mac_util.h" |
22 #endif | 22 #endif |
23 | 23 |
24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
25 #include "base/win/metro.h" | 25 #include "base/win/metro.h" |
26 #include "ui/gfx/dpi_win.h" | 26 #include "ui/gfx/win/dpi.h" |
27 #include <Windows.h> | 27 #include <Windows.h> |
28 #endif // defined(OS_WIN) | 28 #endif // defined(OS_WIN) |
29 | 29 |
30 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
31 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
32 #endif | 32 #endif |
33 | 33 |
34 namespace ui { | 34 namespace ui { |
35 | 35 |
36 namespace { | 36 namespace { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 218 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); |
219 if (screen->IsDIPEnabled()) { | 219 if (screen->IsDIPEnabled()) { |
220 gfx::Display display = screen->GetDisplayNearestWindow(view); | 220 gfx::Display display = screen->GetDisplayNearestWindow(view); |
221 return GetScaleFactorFromScale(display.device_scale_factor()); | 221 return GetScaleFactorFromScale(display.device_scale_factor()); |
222 } | 222 } |
223 return ui::SCALE_FACTOR_100P; | 223 return ui::SCALE_FACTOR_100P; |
224 } | 224 } |
225 #endif // !defined(OS_MACOSX) | 225 #endif // !defined(OS_MACOSX) |
226 | 226 |
227 } // namespace ui | 227 } // namespace ui |
OLD | NEW |