| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "ui/gfx/screen.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 namespace gfx { | 9 namespace gfx { |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // static | 47 // static |
| 48 gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) { | 48 gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) { |
| 49 return GetMonitorAreaOrWorkAreaNearestPoint(point, true); | 49 return GetMonitorAreaOrWorkAreaNearestPoint(point, true); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // static | 52 // static |
| 53 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) { | 53 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) { |
| 54 return GetMonitorAreaOrWorkAreaNearestPoint(point, false); | 54 return GetMonitorAreaOrWorkAreaNearestPoint(point, false); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // static |
| 57 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { | 58 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { |
| 58 POINT location; | 59 POINT location; |
| 59 return GetCursorPos(&location) ? WindowFromPoint(location) : NULL; | 60 return GetCursorPos(&location) ? WindowFromPoint(location) : NULL; |
| 60 } | 61 } |
| 61 | 62 |
| 63 // static |
| 64 gfx::Size Screen::GetPrimaryMonitorSize() { |
| 65 return gfx::Size(GetSystemMetrics(SM_CXSCREEN), |
| 66 GetSystemMetrics(SM_CYSCREEN)); |
| 67 } |
| 68 |
| 69 // static |
| 70 int Screen::GetNumMonitors() { |
| 71 return GetSystemMetrics(SM_CMONITORS); |
| 72 } |
| 73 |
| 62 } // namespace gfx | 74 } // namespace gfx |
| OLD | NEW |