Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Side by Side Diff: ui/gfx/screen_win.cc

Issue 8382019: Move DisplayUtils methods into gfx::Screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DCHECKS Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/gfx/screen_unittest.cc ('k') | ui/ui_unittests.gypi » ('j') | ui/ui_unittests.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698