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

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

Issue 10389109: Add gfx::Screen::IsEnabled() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer diff Created 8 years, 7 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_android.cc ('k') | ui/gfx/screen_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compositor/dip_util.h"
8 #include "ui/gfx/monitor.h" 9 #include "ui/gfx/monitor.h"
9 #include "ui/gfx/native_widget_types.h" 10 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/screen_impl.h" 11 #include "ui/gfx/screen_impl.h"
11 12
12 namespace gfx { 13 namespace gfx {
13 14
14 // gfx can't depend upon aura, otherwise we have circular dependencies. So, 15 // gfx can't depend upon aura, otherwise we have circular dependencies. So,
15 // gfx::Screen is pluggable and Desktop plugs in the real implementation. 16 // gfx::Screen is pluggable and Desktop plugs in the real implementation.
16 namespace { 17 namespace {
17 ScreenImpl* g_instance_ = NULL; 18 ScreenImpl* g_instance_ = NULL;
18 } 19 }
19 20
20 // static 21 // static
21 void Screen::SetInstance(ScreenImpl* screen) { 22 void Screen::SetInstance(ScreenImpl* screen) {
22 delete g_instance_; 23 delete g_instance_;
23 g_instance_ = screen; 24 g_instance_ = screen;
24 } 25 }
25 26
26 // TODO(oshima): Implement ScreenImpl for Linux/aura and remove this 27 // TODO(oshima): Implement ScreenImpl for Linux/aura and remove this
27 // ifdef. 28 // ifdef.
28 29
29 // static 30 // static
31 bool Screen::IsDIPEnabled() {
32 return ui::IsDIPEnabled();
oshima 2012/05/17 15:18:41 DIP is always enabled on aura now. can you make th
33 }
34
35 // static
30 Point Screen::GetCursorScreenPoint() { 36 Point Screen::GetCursorScreenPoint() {
31 return g_instance_->GetCursorScreenPoint(); 37 return g_instance_->GetCursorScreenPoint();
32 } 38 }
33 39
34 // static 40 // static
35 NativeWindow Screen::GetWindowAtCursorScreenPoint() { 41 NativeWindow Screen::GetWindowAtCursorScreenPoint() {
36 return g_instance_->GetWindowAtCursorScreenPoint(); 42 return g_instance_->GetWindowAtCursorScreenPoint();
37 } 43 }
38 44
39 // static 45 // static
(...skipping 15 matching lines...) Expand all
55 Monitor Screen::GetPrimaryMonitor() { 61 Monitor Screen::GetPrimaryMonitor() {
56 return g_instance_->GetPrimaryMonitor(); 62 return g_instance_->GetPrimaryMonitor();
57 } 63 }
58 64
59 // static 65 // static
60 Monitor Screen::GetMonitorMatching(const gfx::Rect& match_rect) { 66 Monitor Screen::GetMonitorMatching(const gfx::Rect& match_rect) {
61 return g_instance_->GetMonitorNearestPoint(match_rect.CenterPoint()); 67 return g_instance_->GetMonitorNearestPoint(match_rect.CenterPoint());
62 } 68 }
63 69
64 } // namespace gfx 70 } // namespace gfx
OLDNEW
« no previous file with comments | « 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