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/gfx/display.h" | 10 #include "ui/gfx/display.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 namespace gfx { | 30 namespace gfx { |
31 | 31 |
32 ScreenWin::ScreenWin() { | 32 ScreenWin::ScreenWin() { |
33 } | 33 } |
34 | 34 |
35 ScreenWin::~ScreenWin() { | 35 ScreenWin::~ScreenWin() { |
36 } | 36 } |
37 | 37 |
38 bool ScreenWin::IsDIPEnabled() { | 38 bool ScreenWin::IsDIPEnabled() { |
39 #if defined(ENABLE_HIDPI) | |
40 return true; | |
41 #else | |
39 return false; | 42 return false; |
43 #endif | |
40 } | 44 } |
41 | 45 |
42 gfx::Point ScreenWin::GetCursorScreenPoint() { | 46 gfx::Point ScreenWin::GetCursorScreenPoint() { |
43 POINT pt; | 47 POINT pt; |
44 GetCursorPos(&pt); | 48 GetCursorPos(&pt); |
45 return gfx::Point(pt); | 49 return gfx::Point(pt); |
46 } | 50 } |
47 | 51 |
48 gfx::NativeWindow ScreenWin::GetWindowAtCursorScreenPoint() { | 52 gfx::NativeWindow ScreenWin::GetWindowAtCursorScreenPoint() { |
49 POINT location; | 53 POINT location; |
(...skipping 28 matching lines...) Expand all Loading... | |
78 RECT other_bounds_rect = match_rect.ToRECT(); | 82 RECT other_bounds_rect = match_rect.ToRECT(); |
79 MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect( | 83 MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect( |
80 &other_bounds_rect, MONITOR_DEFAULTTONEAREST)); | 84 &other_bounds_rect, MONITOR_DEFAULTTONEAREST)); |
81 return GetDisplay(monitor_info); | 85 return GetDisplay(monitor_info); |
82 } | 86 } |
83 | 87 |
84 gfx::Display ScreenWin::GetPrimaryDisplay() const { | 88 gfx::Display ScreenWin::GetPrimaryDisplay() const { |
85 MONITORINFO mi = GetMonitorInfoForMonitor( | 89 MONITORINFO mi = GetMonitorInfoForMonitor( |
86 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)); | 90 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)); |
87 gfx::Display display = GetDisplay(mi); | 91 gfx::Display display = GetDisplay(mi); |
92 #if !defined(ENABLE_HIDPI) | |
pkotwicz
2013/01/23 19:39:23
Nit.
This is up to you but you probably want a TOD
kevers
2013/01/23 21:37:00
Done.
| |
88 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width()); | 93 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width()); |
89 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height()); | 94 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height()); |
95 #endif | |
90 return display; | 96 return display; |
91 } | 97 } |
92 | 98 |
93 void ScreenWin::AddObserver(DisplayObserver* observer) { | 99 void ScreenWin::AddObserver(DisplayObserver* observer) { |
94 // TODO(oshima): crbug.com/122863. | 100 // TODO(oshima): crbug.com/122863. |
95 } | 101 } |
96 | 102 |
97 void ScreenWin::RemoveObserver(DisplayObserver* observer) { | 103 void ScreenWin::RemoveObserver(DisplayObserver* observer) { |
98 // TODO(oshima): crbug.com/122863. | 104 // TODO(oshima): crbug.com/122863. |
99 } | 105 } |
(...skipping 16 matching lines...) Expand all Loading... | |
116 #endif // USE_AURA | 122 #endif // USE_AURA |
117 } | 123 } |
118 | 124 |
119 #if !defined(USE_AURA) | 125 #if !defined(USE_AURA) |
120 Screen* CreateNativeScreen() { | 126 Screen* CreateNativeScreen() { |
121 return new ScreenWin; | 127 return new ScreenWin; |
122 } | 128 } |
123 #endif // !USE_AURA | 129 #endif // !USE_AURA |
124 | 130 |
125 } // namespace gfx | 131 } // namespace gfx |
OLD | NEW |