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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 namespace ash { | 40 namespace ash { |
41 class AshWindowTreeHost; | 41 class AshWindowTreeHost; |
42 struct AshWindowTreeHostInitParams; | 42 struct AshWindowTreeHostInitParams; |
43 class CursorWindowController; | 43 class CursorWindowController; |
44 class DisplayInfo; | 44 class DisplayInfo; |
45 class DisplayManager; | 45 class DisplayManager; |
46 class FocusActivationStore; | 46 class FocusActivationStore; |
47 class MirrorWindowController; | 47 class MirrorWindowController; |
48 class RootWindowController; | 48 class RootWindowController; |
49 class VirtualKeyboardWindowController; | |
50 | 49 |
51 // DisplayController owns and maintains RootWindows for each attached | 50 // DisplayController owns and maintains RootWindows for each attached |
52 // display, keeping them in sync with display configuration changes. | 51 // display, keeping them in sync with display configuration changes. |
53 class ASH_EXPORT DisplayController : public gfx::DisplayObserver, | 52 class ASH_EXPORT DisplayController : public gfx::DisplayObserver, |
54 public aura::WindowTreeHostObserver, | 53 public aura::WindowTreeHostObserver, |
55 public DisplayManager::Delegate { | 54 public DisplayManager::Delegate { |
56 public: | 55 public: |
57 class ASH_EXPORT Observer { | 56 class ASH_EXPORT Observer { |
58 public: | 57 public: |
59 // Invoked only once after all displays are initialized | 58 // Invoked only once after all displays are initialized |
(...skipping 23 matching lines...) Expand all Loading... |
83 static int64 GetPrimaryDisplayId(); | 82 static int64 GetPrimaryDisplayId(); |
84 | 83 |
85 CursorWindowController* cursor_window_controller() { | 84 CursorWindowController* cursor_window_controller() { |
86 return cursor_window_controller_.get(); | 85 return cursor_window_controller_.get(); |
87 } | 86 } |
88 | 87 |
89 MirrorWindowController* mirror_window_controller() { | 88 MirrorWindowController* mirror_window_controller() { |
90 return mirror_window_controller_.get(); | 89 return mirror_window_controller_.get(); |
91 } | 90 } |
92 | 91 |
93 VirtualKeyboardWindowController* virtual_keyboard_window_controller() { | |
94 return virtual_keyboard_window_controller_.get(); | |
95 } | |
96 | |
97 // Create a WindowTreeHost for the primary display. This replaces | 92 // Create a WindowTreeHost for the primary display. This replaces |
98 // |initial_bounds| in |init_params|. | 93 // |initial_bounds| in |init_params|. |
99 void CreatePrimaryHost(const AshWindowTreeHostInitParams& init_params); | 94 void CreatePrimaryHost(const AshWindowTreeHostInitParams& init_params); |
100 | 95 |
101 // Initializes all displays. | 96 // Initializes all displays. |
102 void InitDisplays(); | 97 void InitDisplays(); |
103 | 98 |
104 // Add/Remove observers. | 99 // Add/Remove observers. |
105 void AddObserver(Observer* observer); | 100 void AddObserver(Observer* observer); |
106 void RemoveObserver(Observer* observer); | 101 void RemoveObserver(Observer* observer); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 ObserverList<Observer> observers_; | 204 ObserverList<Observer> observers_; |
210 | 205 |
211 // Store the primary window tree host temporarily while replacing | 206 // Store the primary window tree host temporarily while replacing |
212 // display. | 207 // display. |
213 AshWindowTreeHost* primary_tree_host_for_replace_; | 208 AshWindowTreeHost* primary_tree_host_for_replace_; |
214 | 209 |
215 scoped_ptr<FocusActivationStore> focus_activation_store_; | 210 scoped_ptr<FocusActivationStore> focus_activation_store_; |
216 | 211 |
217 scoped_ptr<CursorWindowController> cursor_window_controller_; | 212 scoped_ptr<CursorWindowController> cursor_window_controller_; |
218 scoped_ptr<MirrorWindowController> mirror_window_controller_; | 213 scoped_ptr<MirrorWindowController> mirror_window_controller_; |
219 scoped_ptr<VirtualKeyboardWindowController> | |
220 virtual_keyboard_window_controller_; | |
221 | 214 |
222 // Stores the curent cursor location (in native coordinates) used to | 215 // Stores the curent cursor location (in native coordinates) used to |
223 // restore the cursor location when display configuration | 216 // restore the cursor location when display configuration |
224 // changed. | 217 // changed. |
225 gfx::Point cursor_location_in_native_coords_for_restore_; | 218 gfx::Point cursor_location_in_native_coords_for_restore_; |
226 | 219 |
227 base::WeakPtrFactory<DisplayController> weak_ptr_factory_; | 220 base::WeakPtrFactory<DisplayController> weak_ptr_factory_; |
228 | 221 |
229 DISALLOW_COPY_AND_ASSIGN(DisplayController); | 222 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
230 }; | 223 }; |
231 | 224 |
232 } // namespace ash | 225 } // namespace ash |
233 | 226 |
234 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 227 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
OLD | NEW |