| 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 #ifndef UI_GFX_SCREEN_H_ | 5 #ifndef UI_GFX_SCREEN_H_ |
| 6 #define UI_GFX_SCREEN_H_ | 6 #define UI_GFX_SCREEN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
| 11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 | 15 |
| 16 // A utility class for getting various info about screen size, monitors, | 16 // A utility class for getting various info about screen size, monitors, |
| 17 // cursor position, etc. | 17 // cursor position, etc. |
| 18 // TODO(erikkay) add more of those methods here | 18 // TODO(erikkay) add more of those methods here |
| 19 class UI_EXPORT Screen { | 19 class UI_EXPORT Screen { |
| 20 public: | 20 public: |
| 21 virtual ~Screen() {} | 21 virtual ~Screen() {} |
| 22 | 22 |
| 23 #if defined(USE_AURA) | 23 #if defined(USE_ASH) |
| 24 // Sets the instance to use. This takes owernship of |screen|, deleting the | 24 // Sets the instance to use. This takes owernship of |screen|, deleting the |
| 25 // old instance. This is used on aura to avoid circular dependencies between | 25 // old instance. This is used on aura to avoid circular dependencies between |
| 26 // ui and aura. | 26 // ui and aura. |
| 27 static void SetInstance(Screen* screen); | 27 static void SetInstance(Screen* screen); |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 // Returns the current absolute position of the mouse pointer. | 30 // Returns the current absolute position of the mouse pointer. |
| 31 static gfx::Point GetCursorScreenPoint(); | 31 static gfx::Point GetCursorScreenPoint(); |
| 32 | 32 |
| 33 // Returns the work area of the monitor nearest the specified window. | 33 // Returns the work area of the monitor nearest the specified window. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 private: | 81 private: |
| 82 #if defined(USE_AURA) | 82 #if defined(USE_AURA) |
| 83 // The singleton screen instance. Only used on aura. | 83 // The singleton screen instance. Only used on aura. |
| 84 static Screen* instance_; | 84 static Screen* instance_; |
| 85 #endif | 85 #endif |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace gfx | 88 } // namespace gfx |
| 89 | 89 |
| 90 #endif // VIEWS_SCREEN_H_ | 90 #endif // VIEWS_SCREEN_H_ |
| OLD | NEW |