| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 EnumDisplayMonitors(NULL, NULL, EnumMonitorCallback, | 80 EnumDisplayMonitors(NULL, NULL, EnumMonitorCallback, |
| 81 reinterpret_cast<LPARAM>(&displays)); | 81 reinterpret_cast<LPARAM>(&displays)); |
| 82 return displays; | 82 return displays; |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace | 85 } // namespace |
| 86 | 86 |
| 87 namespace gfx { | 87 namespace gfx { |
| 88 | 88 |
| 89 ScreenWin::ScreenWin() | 89 ScreenWin::ScreenWin() |
| 90 : displays_(GetDisplays()), | 90 : singleton_hwnd_observer_(new SingletonHwndObserver( |
| 91 singleton_hwnd_observer_(new SingletonHwndObserver( | 91 base::Bind(&ScreenWin::OnWndProc, base::Unretained(this)))), |
| 92 base::Bind(&ScreenWin::OnWndProc, base::Unretained(this)))) {} | 92 displays_(GetDisplays()) { |
| 93 } |
| 93 | 94 |
| 94 ScreenWin::~ScreenWin() {} | 95 ScreenWin::~ScreenWin() {} |
| 95 | 96 |
| 96 gfx::Point ScreenWin::GetCursorScreenPoint() { | 97 gfx::Point ScreenWin::GetCursorScreenPoint() { |
| 97 POINT pt; | 98 POINT pt; |
| 98 GetCursorPos(&pt); | 99 GetCursorPos(&pt); |
| 99 gfx::Point cursor_pos_pixels(pt); | 100 gfx::Point cursor_pos_pixels(pt); |
| 100 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); | 101 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); |
| 101 } | 102 } |
| 102 | 103 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 NOTREACHED(); | 194 NOTREACHED(); |
| 194 return NULL; | 195 return NULL; |
| 195 } | 196 } |
| 196 | 197 |
| 197 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { | 198 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { |
| 198 NOTREACHED(); | 199 NOTREACHED(); |
| 199 return NULL; | 200 return NULL; |
| 200 } | 201 } |
| 201 | 202 |
| 202 } // namespace gfx | 203 } // namespace gfx |
| OLD | NEW |