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/gfx/screen_win.h" | 5 #include "ui/gfx/screen_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/base/win/dpi.h" |
10 #include "ui/gfx/display.h" | 11 #include "ui/gfx/display.h" |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 MONITORINFO GetMonitorInfoForMonitor(HMONITOR monitor) { | 15 MONITORINFO GetMonitorInfoForMonitor(HMONITOR monitor) { |
15 MONITORINFO monitor_info = { 0 }; | 16 MONITORINFO monitor_info = { 0 }; |
16 monitor_info.cbSize = sizeof(monitor_info); | 17 monitor_info.cbSize = sizeof(monitor_info); |
17 GetMonitorInfo(monitor, &monitor_info); | 18 GetMonitorInfo(monitor, &monitor_info); |
18 return monitor_info; | 19 return monitor_info; |
19 } | 20 } |
20 | 21 |
21 gfx::Display GetDisplay(MONITORINFO& monitor_info) { | 22 gfx::Display GetDisplay(MONITORINFO& monitor_info) { |
22 // TODO(oshima): Implement ID and Observer. | 23 // TODO(oshima): Implement ID and Observer. |
23 gfx::Display display(0, gfx::Rect(monitor_info.rcMonitor)); | 24 gfx::Rect bounds = gfx::Rect(monitor_info.rcMonitor); |
| 25 gfx::Display display(0, bounds); |
24 display.set_work_area(gfx::Rect(monitor_info.rcWork)); | 26 display.set_work_area(gfx::Rect(monitor_info.rcWork)); |
| 27 display.SetScaleAndBounds(ui::win::GetDeviceScaleFactor(), bounds); |
25 return display; | 28 return display; |
26 } | 29 } |
27 | 30 |
28 } // namespace | 31 } // namespace |
29 | 32 |
30 namespace gfx { | 33 namespace gfx { |
31 | 34 |
32 ScreenWin::ScreenWin() { | 35 ScreenWin::ScreenWin() { |
33 } | 36 } |
34 | 37 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 #endif // USE_AURA | 134 #endif // USE_AURA |
132 } | 135 } |
133 | 136 |
134 #if !defined(USE_AURA) | 137 #if !defined(USE_AURA) |
135 Screen* CreateNativeScreen() { | 138 Screen* CreateNativeScreen() { |
136 return new ScreenWin; | 139 return new ScreenWin; |
137 } | 140 } |
138 #endif // !USE_AURA | 141 #endif // !USE_AURA |
139 | 142 |
140 } // namespace gfx | 143 } // namespace gfx |
OLD | NEW |