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

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

Issue 9616045: Aura/Ash split: Move ScreenAura to ash::ScreenAsh. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a separate aura::TestScreen in tests instead, partially reverting to patchset 2 Created 8 years, 9 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
« no previous file with comments | « ui/gfx/screen_ash.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/gfx/screen.h"
6
7 #include "base/logging.h"
8 #include "ui/gfx/native_widget_types.h"
9
10 namespace gfx {
11
12 // gfx can't depend upon aura, otherwise we have circular dependencies. So,
13 // gfx::Screen is pluggable for aura and Desktop plugs in the real
14 // implementation.
15
16 // static
17 Screen* Screen::instance_ = NULL;
18
19 // static
20 void Screen::SetInstance(Screen* screen) {
21 delete instance_;
22 instance_ = screen;
23 }
24
25 // static
26 gfx::Point Screen::GetCursorScreenPoint() {
27 return instance_->GetCursorScreenPointImpl();
28 }
29
30 // static
31 gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeWindow window) {
32 return instance_->GetMonitorWorkAreaNearestWindowImpl(window);
33 }
34
35 // static
36 gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeWindow window) {
37 return instance_->GetMonitorAreaNearestWindowImpl(window);
38 }
39
40 // static
41 gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) {
42 return instance_->GetMonitorWorkAreaNearestPointImpl(point);
43 }
44
45 // static
46 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) {
47 return instance_->GetMonitorAreaNearestPointImpl(point);
48 }
49
50 // static
51 gfx::Rect Screen::GetPrimaryMonitorWorkArea() {
52 return instance_->GetMonitorWorkAreaNearestPoint(gfx::Point());
53 }
54
55 // static
56 gfx::Rect Screen::GetPrimaryMonitorBounds() {
57 return instance_->GetMonitorAreaNearestPoint(gfx::Point());
58 }
59
60 // static
61 gfx::Rect Screen::GetMonitorWorkAreaMatching(const gfx::Rect& match_rect) {
62 return instance_->GetMonitorWorkAreaNearestPoint(gfx::Point());
63 }
64
65 // static
66 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() {
67 return instance_->GetWindowAtCursorScreenPointImpl();
68 }
69
70 // static
71 gfx::Size Screen::GetPrimaryMonitorSize() {
72 return instance_->GetPrimaryMonitorSizeImpl();
73 }
74
75 // static
76 int Screen::GetNumMonitors() {
77 return instance_->GetNumMonitorsImpl();
78 }
79
80 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/screen_ash.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698