Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: ash/root_window_controller.h

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ROOT_WINDOW_CONTROLLER_H_ 5 #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_
6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ 6 #define ASH_ROOT_WINDOW_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 29 matching lines...) Expand all
40 class Widget; 40 class Widget;
41 } 41 }
42 42
43 namespace wm { 43 namespace wm {
44 class InputMethodEventFilter; 44 class InputMethodEventFilter;
45 class RootWindowEventFilter; 45 class RootWindowEventFilter;
46 class ScopedCaptureClient; 46 class ScopedCaptureClient;
47 } 47 }
48 48
49 namespace ash { 49 namespace ash {
50 class AshWindowTreeHost;
50 class AlwaysOnTopController; 51 class AlwaysOnTopController;
51 class AnimatingDesktopController; 52 class AnimatingDesktopController;
52 class DesktopBackgroundWidgetController; 53 class DesktopBackgroundWidgetController;
53 class DockedWindowLayoutManager; 54 class DockedWindowLayoutManager;
54 class PanelLayoutManager; 55 class PanelLayoutManager;
55 class RootWindowLayoutManager; 56 class RootWindowLayoutManager;
56 class ScreenDimmer; 57 class ScreenDimmer;
57 class ShelfLayoutManager; 58 class ShelfLayoutManager;
58 class ShelfWidget; 59 class ShelfWidget;
59 class StackingController; 60 class StackingController;
(...skipping 13 matching lines...) Expand all
73 // owns the root window and other dependent objects that should be 74 // owns the root window and other dependent objects that should be
74 // deleted upon the deletion of the root window. This object is 75 // deleted upon the deletion of the root window. This object is
75 // indirectly owned and deleted by |DisplayController|. 76 // indirectly owned and deleted by |DisplayController|.
76 // The RootWindowController for particular root window is stored in 77 // The RootWindowController for particular root window is stored in
77 // its property (RootWindowSettings) and can be obtained using 78 // its property (RootWindowSettings) and can be obtained using
78 // |GetRootWindowController(aura::WindowEventDispatcher*)| function. 79 // |GetRootWindowController(aura::WindowEventDispatcher*)| function.
79 class ASH_EXPORT RootWindowController : public ShellObserver { 80 class ASH_EXPORT RootWindowController : public ShellObserver {
80 public: 81 public:
81 82
82 // Creates and Initialize the RootWindowController for primary display. 83 // Creates and Initialize the RootWindowController for primary display.
83 static void CreateForPrimaryDisplay(aura::WindowTreeHost* host); 84 static void CreateForPrimaryDisplay(AshWindowTreeHost* host);
84 85
85 // Creates and Initialize the RootWindowController for secondary displays. 86 // Creates and Initialize the RootWindowController for secondary displays.
86 static void CreateForSecondaryDisplay(aura::WindowTreeHost* host); 87 static void CreateForSecondaryDisplay(AshWindowTreeHost* host);
87 88
88 // Creates and Initialize the RootWindowController for virtual 89 // Creates and Initialize the RootWindowController for virtual
89 // keyboard displays. 90 // keyboard displays.
90 static void CreateForVirtualKeyboardDisplay(aura::WindowTreeHost* host); 91 static void CreateForVirtualKeyboardDisplay(AshWindowTreeHost* host);
91 92
92 // Returns a RootWindowController that has a shelf for given 93 // Returns a RootWindowController that has a shelf for given
93 // |window|. This returns the RootWindowController for the |window|'s 94 // |window|. This returns the RootWindowController for the |window|'s
94 // root window when multiple shelf mode is enabled, or the primary 95 // root window when multiple shelf mode is enabled, or the primary
95 // RootWindowController otherwise. 96 // RootWindowController otherwise.
96 static RootWindowController* ForShelf(aura::Window* window); 97 static RootWindowController* ForShelf(aura::Window* window);
97 98
98 // Returns a RootWindowController of the window's root window. 99 // Returns a RootWindowController of the window's root window.
99 static RootWindowController* ForWindow(const aura::Window* window); 100 static RootWindowController* ForWindow(const aura::Window* window);
100 101
101 // Returns the RootWindowController of the target root window. 102 // Returns the RootWindowController of the target root window.
102 static RootWindowController* ForTargetRootWindow(); 103 static RootWindowController* ForTargetRootWindow();
103 104
104 // Returns container which contains a given |window|. 105 // Returns container which contains a given |window|.
105 static aura::Window* GetContainerForWindow(aura::Window* window); 106 static aura::Window* GetContainerForWindow(aura::Window* window);
106 107
107 virtual ~RootWindowController(); 108 virtual ~RootWindowController();
108 109
109 aura::Window* root_window() { return host_->window(); } 110 AshWindowTreeHost* ash_host() { return ash_host_.get(); }
110 const aura::Window* root_window() const { return host_->window(); } 111 const AshWindowTreeHost* ash_host() const { return ash_host_.get(); }
111 aura::WindowTreeHost* host() { return host_.get(); } 112
112 const aura::WindowTreeHost* host() const { return host_.get(); } 113 aura::WindowTreeHost* GetHost();
114 const aura::WindowTreeHost* GetHost() const;
115 aura::Window* GetRootWindow();
116 const aura::Window* GetRootWindow() const;
113 117
114 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } 118 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; }
115 119
116 WorkspaceController* workspace_controller() { 120 WorkspaceController* workspace_controller() {
117 return workspace_controller_.get(); 121 return workspace_controller_.get();
118 } 122 }
119 123
120 AlwaysOnTopController* always_on_top_controller() { 124 AlwaysOnTopController* always_on_top_controller() {
121 return always_on_top_controller_.get(); 125 return always_on_top_controller_.get();
122 } 126 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // Activate virtual keyboard on current root window controller. 232 // Activate virtual keyboard on current root window controller.
229 void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller); 233 void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller);
230 234
231 // Deactivate virtual keyboard on current root window controller. 235 // Deactivate virtual keyboard on current root window controller.
232 void DeactivateKeyboard(keyboard::KeyboardController* keyboard_controller); 236 void DeactivateKeyboard(keyboard::KeyboardController* keyboard_controller);
233 237
234 // Tests if a window is associated with the virtual keyboard. 238 // Tests if a window is associated with the virtual keyboard.
235 bool IsVirtualKeyboardWindow(aura::Window* window); 239 bool IsVirtualKeyboardWindow(aura::Window* window);
236 240
237 private: 241 private:
238 explicit RootWindowController(aura::WindowTreeHost* host); 242 explicit RootWindowController(AshWindowTreeHost* host);
239 enum RootWindowType { 243 enum RootWindowType {
240 PRIMARY, 244 PRIMARY,
241 SECONDARY, 245 SECONDARY,
242 VIRTUAL_KEYBOARD 246 VIRTUAL_KEYBOARD
243 }; 247 };
244 248
245 // Initializes the RootWindowController. |is_primary| is true if 249 // Initializes the RootWindowController. |is_primary| is true if
246 // the controller is for primary display. |first_run_after_boot| is 250 // the controller is for primary display. |first_run_after_boot| is
247 // set to true only for primary root window after boot. 251 // set to true only for primary root window after boot.
248 void Init(RootWindowType root_window_type, bool first_run_after_boot); 252 void Init(RootWindowType root_window_type, bool first_run_after_boot);
(...skipping 11 matching lines...) Expand all
260 // Enables projection touch HUD. 264 // Enables projection touch HUD.
261 void EnableTouchHudProjection(); 265 void EnableTouchHudProjection();
262 266
263 // Disables projection touch HUD. 267 // Disables projection touch HUD.
264 void DisableTouchHudProjection(); 268 void DisableTouchHudProjection();
265 269
266 // Overridden from ShellObserver. 270 // Overridden from ShellObserver.
267 virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE; 271 virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE;
268 virtual void OnTouchHudProjectionToggled(bool enabled) OVERRIDE; 272 virtual void OnTouchHudProjectionToggled(bool enabled) OVERRIDE;
269 273
270 scoped_ptr<aura::WindowTreeHost> host_; 274 scoped_ptr<AshWindowTreeHost> ash_host_;
271 RootWindowLayoutManager* root_window_layout_; 275 RootWindowLayoutManager* root_window_layout_;
272 276
273 scoped_ptr<StackingController> stacking_controller_; 277 scoped_ptr<StackingController> stacking_controller_;
274 278
275 // The shelf for managing the shelf and the status widget. 279 // The shelf for managing the shelf and the status widget.
276 scoped_ptr<ShelfWidget> shelf_; 280 scoped_ptr<ShelfWidget> shelf_;
277 281
278 // An invisible/empty window used as a event target for 282 // An invisible/empty window used as a event target for
279 // |MouseCursorEventFilter| before a user logs in. 283 // |MouseCursorEventFilter| before a user logs in.
280 // (crbug.com/266987) 284 // (crbug.com/266987)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 }; 317 };
314 318
315 319
316 // Gets the RootWindowController for |root_window|. 320 // Gets the RootWindowController for |root_window|.
317 ASH_EXPORT RootWindowController* GetRootWindowController( 321 ASH_EXPORT RootWindowController* GetRootWindowController(
318 const aura::Window* root_window); 322 const aura::Window* root_window);
319 323
320 } // ash 324 } // ash
321 325
322 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ 326 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698