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

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

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/gfx/screen.h"
6
7 #include "ui/gfx/monitor.h"
8
9 namespace gfx {
10
11 // Utility functions to get Monitor bounds/WorkArea bounds.
12 // static
13 gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeView view) {
14 Monitor monitor;
15 GetMonitorNearestWindow(view, &monitor);
16 return monitor.bounds();
17 }
18
19 gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeView view) {
20 Monitor monitor;
21 GetMonitorNearestWindow(view, &monitor);
22 return monitor.work_area();
23 }
24
25 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) {
26 Monitor monitor;
27 GetMonitorNearestPoint(point, &monitor);
28 return monitor.bounds();
29 }
30
31 gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) {
32 Monitor monitor;
33 GetMonitorNearestPoint(point, &monitor);
34 return monitor.work_area();
35 }
36
37 gfx::Rect Screen::GetPrimaryMonitorBounds() {
38 Monitor monitor;
39 GetPrimaryMonitor(&monitor);
40 return monitor.bounds();
41 }
42
43 gfx::Rect Screen::GetPrimaryMonitorWorkArea() {
44 Monitor monitor;
45 GetPrimaryMonitor(&monitor);
46 return monitor.work_area();
47 }
48
49 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698