OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "views/screen.h" | 5 #include "views/screen.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 namespace views { | 9 namespace views { |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 HMONITOR monitor = MonitorFromPoint(initial_loc, MONITOR_DEFAULTTONEAREST); | 39 HMONITOR monitor = MonitorFromPoint(initial_loc, MONITOR_DEFAULTTONEAREST); |
40 if (!monitor) | 40 if (!monitor) |
41 return gfx::Rect(); | 41 return gfx::Rect(); |
42 | 42 |
43 MONITORINFO mi = {0}; | 43 MONITORINFO mi = {0}; |
44 mi.cbSize = sizeof(mi); | 44 mi.cbSize = sizeof(mi); |
45 GetMonitorInfo(monitor, &mi); | 45 GetMonitorInfo(monitor, &mi); |
46 return gfx::Rect(mi.rcMonitor); | 46 return gfx::Rect(mi.rcMonitor); |
47 } | 47 } |
48 | 48 |
| 49 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { |
| 50 POINT location; |
| 51 return GetCursorPos(&location) ? WindowFromPoint(location) : NULL; |
| 52 } |
| 53 |
49 } // namespace | 54 } // namespace |
50 | 55 |
OLD | NEW |