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

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

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 8 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) 2012 The Chromium Authors. All rights reserved. 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 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gfx/display.h"
9 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/screen_impl.h"
11 8
12 namespace gfx { 9 namespace gfx {
13 10
14 // gfx can't depend upon aura, otherwise we have circular dependencies. So, 11 Screen* CreateNativeScreen() {
15 // gfx::Screen is pluggable and Desktop plugs in the real implementation. 12 NOTREACHED() << "Implementation should be installed at higher level.";
16 namespace { 13 return NULL;
17 ScreenImpl* g_instance_ = NULL;
18 }
19
20 // static
21 void Screen::SetInstance(ScreenImpl* screen) {
22 delete g_instance_;
23 g_instance_ = screen;
24 }
25
26 // static
27 bool Screen::IsDIPEnabled() {
28 return true;
29 }
30
31 // static
32 Point Screen::GetCursorScreenPoint() {
33 return g_instance_->GetCursorScreenPoint();
34 }
35
36 // static
37 NativeWindow Screen::GetWindowAtCursorScreenPoint() {
38 return g_instance_->GetWindowAtCursorScreenPoint();
39 }
40
41 // static
42 int Screen::GetNumDisplays() {
43 return g_instance_->GetNumDisplays();
44 }
45
46 // static
47 Display Screen::GetDisplayNearestWindow(NativeView window) {
48 return g_instance_->GetDisplayNearestWindow(window);
49 }
50
51 // static
52 Display Screen::GetDisplayNearestPoint(const Point& point) {
53 return g_instance_->GetDisplayNearestPoint(point);
54 }
55
56 // static
57 Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) {
58 return g_instance_->GetDisplayMatching(match_rect);
59 }
60
61 // static
62 Display Screen::GetPrimaryDisplay() {
63 return g_instance_->GetPrimaryDisplay();
64 } 14 }
65 15
66 } // namespace gfx 16 } // namespace gfx
OLDNEW
« ui/gfx/screen.cc ('K') | « ui/gfx/screen_android.cc ('k') | ui/gfx/screen_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698