| OLD | NEW |
| (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 | |
| OLD | NEW |