| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 | 11 |
| 12 // gfx can't depend upon aura, otherwise we have circular dependencies. So, | 12 // gfx can't depend upon ash, otherwise we have circular dependencies. So, |
| 13 // gfx::Screen is pluggable for aura and Desktop plugs in the real | 13 // gfx::Screen is pluggable and Desktop plugs in the real implementation. |
| 14 // implementation. | |
| 15 | 14 |
| 16 // static | 15 // static |
| 17 Screen* Screen::instance_ = NULL; | 16 Screen* Screen::instance_ = NULL; |
| 18 | 17 |
| 19 // static | 18 // static |
| 20 void Screen::SetInstance(Screen* screen) { | 19 void Screen::SetInstance(Screen* screen) { |
| 21 delete instance_; | 20 delete instance_; |
| 22 instance_ = screen; | 21 instance_ = screen; |
| 23 } | 22 } |
| 24 | 23 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 gfx::Size Screen::GetPrimaryMonitorSize() { | 70 gfx::Size Screen::GetPrimaryMonitorSize() { |
| 72 return instance_->GetPrimaryMonitorSizeImpl(); | 71 return instance_->GetPrimaryMonitorSizeImpl(); |
| 73 } | 72 } |
| 74 | 73 |
| 75 // static | 74 // static |
| 76 int Screen::GetNumMonitors() { | 75 int Screen::GetNumMonitors() { |
| 77 return instance_->GetNumMonitorsImpl(); | 76 return instance_->GetNumMonitorsImpl(); |
| 78 } | 77 } |
| 79 | 78 |
| 80 } // namespace gfx | 79 } // namespace gfx |
| OLD | NEW |