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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 virtual gfx::Display GetDisplayMatching( | 84 virtual gfx::Display GetDisplayMatching( |
85 const gfx::Rect& match_rect) const = 0; | 85 const gfx::Rect& match_rect) const = 0; |
86 | 86 |
87 // Returns the primary display. | 87 // Returns the primary display. |
88 virtual gfx::Display GetPrimaryDisplay() const = 0; | 88 virtual gfx::Display GetPrimaryDisplay() const = 0; |
89 | 89 |
90 // Adds/Removes display observers. | 90 // Adds/Removes display observers. |
91 virtual void AddObserver(DisplayObserver* observer) = 0; | 91 virtual void AddObserver(DisplayObserver* observer) = 0; |
92 virtual void RemoveObserver(DisplayObserver* observer) = 0; | 92 virtual void RemoveObserver(DisplayObserver* observer) = 0; |
93 | 93 |
| 94 // Converts |screen_rect| to DIP coordinates in the context of view. If |view| |
| 95 // is null, the primary display is used as the context. |
| 96 virtual gfx::Rect ScreenToDIPRectInWindow(NativeView view, |
| 97 const gfx::Rect& screen_rect) const; |
| 98 |
| 99 // Converts |dip_rect| to screen coordinates in the context of view. If |view| |
| 100 // is null, the primary display is used as the context. |
| 101 virtual gfx::Rect DIPToScreenRectInWindow(NativeView view, |
| 102 const gfx::Rect& dip_rect) const; |
| 103 |
94 private: | 104 private: |
95 DISALLOW_COPY_AND_ASSIGN(Screen); | 105 DISALLOW_COPY_AND_ASSIGN(Screen); |
96 }; | 106 }; |
97 | 107 |
98 Screen* CreateNativeScreen(); | 108 Screen* CreateNativeScreen(); |
99 | 109 |
100 } // namespace gfx | 110 } // namespace gfx |
101 | 111 |
102 #endif // UI_GFX_SCREEN_H_ | 112 #endif // UI_GFX_SCREEN_H_ |
OLD | NEW |