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 ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 protected: | 65 protected: |
66 virtual ~Observer() {} | 66 virtual ~Observer() {} |
67 }; | 67 }; |
68 | 68 |
69 DisplayController(); | 69 DisplayController(); |
70 virtual ~DisplayController(); | 70 virtual ~DisplayController(); |
71 | 71 |
72 void Start(); | 72 void Start(); |
73 void Shutdown(); | 73 void Shutdown(); |
74 | 74 |
75 // Returns primary display. This is safe to use after ash::Shell is | 75 // Returns primary display's ID. |
76 // deleted. | 76 // TODO(oshima): Move this out from DisplayController; |
77 static const gfx::Display& GetPrimaryDisplay(); | 77 static int64 GetPrimaryDisplayId(); |
78 | |
79 // Returns the number of display. This is safe to use after | |
80 // ash::Shell is deleted. | |
81 static int GetNumDisplays(); | |
82 | 78 |
83 internal::MirrorWindowController* mirror_window_controller() { | 79 internal::MirrorWindowController* mirror_window_controller() { |
84 return mirror_window_controller_.get(); | 80 return mirror_window_controller_.get(); |
85 } | 81 } |
86 | 82 |
87 internal::VirtualKeyboardWindowController* | 83 internal::VirtualKeyboardWindowController* |
88 virtual_keyboard_window_controller() { | 84 virtual_keyboard_window_controller() { |
89 return virtual_keyboard_window_controller_.get(); | 85 return virtual_keyboard_window_controller_.get(); |
90 } | 86 } |
91 | 87 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 gfx::Insets GetOverscanInsets(int64 display_id) const; | 131 gfx::Insets GetOverscanInsets(int64 display_id) const; |
136 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); | 132 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); |
137 | 133 |
138 // Checks if the mouse pointer is on one of displays, and moves to | 134 // Checks if the mouse pointer is on one of displays, and moves to |
139 // the center of the nearest display if it's outside of all displays. | 135 // the center of the nearest display if it's outside of all displays. |
140 void EnsurePointerInDisplays(); | 136 void EnsurePointerInDisplays(); |
141 | 137 |
142 // Sets the work area's |insets| to the display assigned to |window|. | 138 // Sets the work area's |insets| to the display assigned to |window|. |
143 bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window, | 139 bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window, |
144 const gfx::Insets& insets); | 140 const gfx::Insets& insets); |
145 | |
146 // Returns the display object nearest given |point|. | |
147 const gfx::Display& GetDisplayNearestPoint( | |
148 const gfx::Point& point) const; | |
149 | |
150 // Returns the display object nearest given |window|. | |
151 const gfx::Display& GetDisplayNearestWindow( | |
152 const aura::Window* window) const; | |
153 | |
154 // Returns the display that most closely intersects |match_rect|. | |
155 const gfx::Display& GetDisplayMatching( | |
156 const gfx::Rect& match_rect)const; | |
157 | |
158 // aura::DisplayObserver overrides: | 141 // aura::DisplayObserver overrides: |
159 virtual void OnDisplayBoundsChanged( | 142 virtual void OnDisplayBoundsChanged( |
160 const gfx::Display& display) OVERRIDE; | 143 const gfx::Display& display) OVERRIDE; |
161 virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; | 144 virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; |
162 virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; | 145 virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; |
163 | 146 |
164 // RootWindowObserver overrides: | 147 // RootWindowObserver overrides: |
165 virtual void OnWindowTreeHostResized(const aura::RootWindow* root) OVERRIDE; | 148 virtual void OnWindowTreeHostResized(const aura::RootWindow* root) OVERRIDE; |
166 | 149 |
167 // aura::DisplayManager::Delegate overrides: | 150 // aura::DisplayManager::Delegate overrides: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // restore the cursor location when display configuration | 207 // restore the cursor location when display configuration |
225 // changed. | 208 // changed. |
226 gfx::Point cursor_location_in_native_coords_for_restore_; | 209 gfx::Point cursor_location_in_native_coords_for_restore_; |
227 | 210 |
228 DISALLOW_COPY_AND_ASSIGN(DisplayController); | 211 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
229 }; | 212 }; |
230 | 213 |
231 } // namespace ash | 214 } // namespace ash |
232 | 215 |
233 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 216 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
OLD | NEW |