| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 namespace gfx { | 87 namespace gfx { |
| 88 | 88 |
| 89 ScreenWin::ScreenWin() | 89 ScreenWin::ScreenWin() |
| 90 : singleton_hwnd_observer_(new SingletonHwndObserver( | 90 : singleton_hwnd_observer_(new SingletonHwndObserver( |
| 91 base::Bind(&ScreenWin::OnWndProc, base::Unretained(this)))), | 91 base::Bind(&ScreenWin::OnWndProc, base::Unretained(this)))), |
| 92 displays_(GetDisplays()) { | 92 displays_(GetDisplays()) { |
| 93 } | 93 } |
| 94 | 94 |
| 95 ScreenWin::~ScreenWin() {} | 95 ScreenWin::~ScreenWin() {} |
| 96 | 96 |
| 97 HWND ScreenWin::GetHWNDFromNativeView(NativeView window) const { |
| 98 NOTREACHED(); |
| 99 return NULL; |
| 100 } |
| 101 |
| 102 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { |
| 103 NOTREACHED(); |
| 104 return NULL; |
| 105 } |
| 106 |
| 97 gfx::Point ScreenWin::GetCursorScreenPoint() { | 107 gfx::Point ScreenWin::GetCursorScreenPoint() { |
| 98 POINT pt; | 108 POINT pt; |
| 99 GetCursorPos(&pt); | 109 GetCursorPos(&pt); |
| 100 gfx::Point cursor_pos_pixels(pt); | 110 gfx::Point cursor_pos_pixels(pt); |
| 101 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); | 111 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); |
| 102 } | 112 } |
| 103 | 113 |
| 104 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() { | 114 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() { |
| 105 POINT cursor_loc; | 115 POINT cursor_loc; |
| 106 HWND hwnd = GetCursorPos(&cursor_loc) ? WindowFromPoint(cursor_loc) : NULL; | 116 HWND hwnd = GetCursorPos(&cursor_loc) ? WindowFromPoint(cursor_loc) : NULL; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 LPARAM lparam) { | 193 LPARAM lparam) { |
| 184 if (message != WM_DISPLAYCHANGE) | 194 if (message != WM_DISPLAYCHANGE) |
| 185 return; | 195 return; |
| 186 | 196 |
| 187 std::vector<gfx::Display> old_displays = displays_; | 197 std::vector<gfx::Display> old_displays = displays_; |
| 188 displays_ = GetDisplays(); | 198 displays_ = GetDisplays(); |
| 189 | 199 |
| 190 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); | 200 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); |
| 191 } | 201 } |
| 192 | 202 |
| 193 HWND ScreenWin::GetHWNDFromNativeView(NativeView window) const { | |
| 194 NOTREACHED(); | |
| 195 return NULL; | |
| 196 } | |
| 197 | |
| 198 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { | |
| 199 NOTREACHED(); | |
| 200 return NULL; | |
| 201 } | |
| 202 | |
| 203 } // namespace gfx | 203 } // namespace gfx |
| OLD | NEW |