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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 gfx::Display ScreenWin::GetPrimaryDisplay() const { | 84 gfx::Display ScreenWin::GetPrimaryDisplay() const { |
85 MONITORINFO mi = GetMonitorInfoForMonitor( | 85 MONITORINFO mi = GetMonitorInfoForMonitor( |
86 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)); | 86 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)); |
87 gfx::Display display = GetDisplay(mi); | 87 gfx::Display display = GetDisplay(mi); |
88 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width()); | 88 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width()); |
89 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height()); | 89 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height()); |
90 return display; | 90 return display; |
91 } | 91 } |
92 | 92 |
| 93 void ScreenWin::AddObserver(DisplayObserver* observer) { |
| 94 // TODO(oshima): crbug.com/122863. |
| 95 } |
| 96 |
| 97 void ScreenWin::RemoveObserver(DisplayObserver* observer) { |
| 98 // TODO(oshima): crbug.com/122863. |
| 99 } |
| 100 |
93 HWND ScreenWin::GetHWNDFromNativeView(NativeView window) const { | 101 HWND ScreenWin::GetHWNDFromNativeView(NativeView window) const { |
94 #if defined(USE_AURA) | 102 #if defined(USE_AURA) |
95 NOTREACHED(); | 103 NOTREACHED(); |
96 return NULL; | 104 return NULL; |
97 #else | 105 #else |
98 return window; | 106 return window; |
99 #endif // USE_AURA | 107 #endif // USE_AURA |
100 } | 108 } |
101 | 109 |
102 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { | 110 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { |
103 #if defined(USE_AURA) | 111 #if defined(USE_AURA) |
104 NOTREACHED(); | 112 NOTREACHED(); |
105 return NULL; | 113 return NULL; |
106 #else | 114 #else |
107 return hwnd; | 115 return hwnd; |
108 #endif // USE_AURA | 116 #endif // USE_AURA |
109 } | 117 } |
110 | 118 |
111 #if !defined(USE_AURA) | 119 #if !defined(USE_AURA) |
112 Screen* CreateNativeScreen() { | 120 Screen* CreateNativeScreen() { |
113 return new ScreenWin; | 121 return new ScreenWin; |
114 } | 122 } |
115 #endif // !USE_AURA | 123 #endif // !USE_AURA |
116 | 124 |
117 } // namespace gfx | 125 } // namespace gfx |
OLD | NEW |