OLD | NEW |
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 #ifndef UI_GFX_SCREEN_H_ | 5 #ifndef UI_GFX_SCREEN_H_ |
6 #define UI_GFX_SCREEN_H_ | 6 #define UI_GFX_SCREEN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/base/ui_export.h" | 9 #include "ui/base/ui_export.h" |
10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 #include "ui/gfx/point.h" | 12 #include "ui/gfx/point.h" |
13 #include "ui/gfx/screen_type_delegate.h" | 13 #include "ui/gfx/screen_type_delegate.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
| 16 class DisplayObserver; |
16 class Rect; | 17 class Rect; |
17 | 18 |
18 // A utility class for getting various info about screen size, displays, | 19 // A utility class for getting various info about screen size, displays, |
19 // cursor position, etc. | 20 // cursor position, etc. |
20 class UI_EXPORT Screen { | 21 class UI_EXPORT Screen { |
21 public: | 22 public: |
22 // Retrieves the Screen that the specified NativeView belongs to. A value of | 23 // Retrieves the Screen that the specified NativeView belongs to. A value of |
23 // NULL is treated as |SCREEN_TYPE_NATIVE|. | 24 // NULL is treated as |SCREEN_TYPE_NATIVE|. |
24 static Screen* GetScreenFor(NativeView view); | 25 static Screen* GetScreenFor(NativeView view); |
25 | 26 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 virtual gfx::Display GetDisplayNearestPoint( | 64 virtual gfx::Display GetDisplayNearestPoint( |
64 const gfx::Point& point) const = 0; | 65 const gfx::Point& point) const = 0; |
65 | 66 |
66 // Returns the display that most closely intersects the provided bounds. | 67 // Returns the display that most closely intersects the provided bounds. |
67 virtual gfx::Display GetDisplayMatching( | 68 virtual gfx::Display GetDisplayMatching( |
68 const gfx::Rect& match_rect) const = 0; | 69 const gfx::Rect& match_rect) const = 0; |
69 | 70 |
70 // Returns the primary display. | 71 // Returns the primary display. |
71 virtual gfx::Display GetPrimaryDisplay() const = 0; | 72 virtual gfx::Display GetPrimaryDisplay() const = 0; |
72 | 73 |
| 74 // Adds/Removes display observers. |
| 75 virtual void AddObserver(DisplayObserver* observer) = 0; |
| 76 virtual void RemoveObserver(DisplayObserver* observer) = 0; |
| 77 |
73 private: | 78 private: |
74 DISALLOW_COPY_AND_ASSIGN(Screen); | 79 DISALLOW_COPY_AND_ASSIGN(Screen); |
75 }; | 80 }; |
76 | 81 |
77 Screen* CreateNativeScreen(); | 82 Screen* CreateNativeScreen(); |
78 | 83 |
79 } // namespace gfx | 84 } // namespace gfx |
80 | 85 |
81 #endif // UI_GFX_SCREEN_H_ | 86 #endif // UI_GFX_SCREEN_H_ |
OLD | NEW |