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

Side by Side Diff: ash/common/wm_shell.h

Issue 2194353002: mash: Migrate ScopedTargetRootWindow to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-virtual Created 4 years, 4 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
« no previous file with comments | « ash/common/scoped_root_window_for_new_windows.cc ('k') | ash/common/wm_shell.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_COMMON_WM_SHELL_H_ 5 #ifndef ASH_COMMON_WM_SHELL_H_
6 #define ASH_COMMON_WM_SHELL_H_ 6 #define ASH_COMMON_WM_SHELL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 105
106 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } 106 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
107 107
108 MediaDelegate* media_delegate() { return media_delegate_.get(); } 108 MediaDelegate* media_delegate() { return media_delegate_.get(); }
109 109
110 NewWindowDelegate* new_window_delegate() { 110 NewWindowDelegate* new_window_delegate() {
111 return new_window_delegate_.get(); 111 return new_window_delegate_.get();
112 } 112 }
113 113
114 // NOTE: Prefer ScopedRootWindowForNewWindows when setting temporarily.
115 void set_root_window_for_new_windows(WmWindow* root) {
116 root_window_for_new_windows_ = root;
117 }
118
114 ShelfDelegate* shelf_delegate() { return shelf_delegate_.get(); } 119 ShelfDelegate* shelf_delegate() { return shelf_delegate_.get(); }
115 120
116 ShelfModel* shelf_model() { return shelf_model_.get(); } 121 ShelfModel* shelf_model() { return shelf_model_.get(); }
117 122
118 SystemTrayNotifier* system_tray_notifier() { 123 SystemTrayNotifier* system_tray_notifier() {
119 return system_tray_notifier_.get(); 124 return system_tray_notifier_.get();
120 } 125 }
121 126
122 SystemTrayDelegate* system_tray_delegate() { 127 SystemTrayDelegate* system_tray_delegate() {
123 return system_tray_delegate_.get(); 128 return system_tray_delegate_.get();
(...skipping 15 matching lines...) Expand all
139 144
140 virtual WmWindow* GetFocusedWindow() = 0; 145 virtual WmWindow* GetFocusedWindow() = 0;
141 virtual WmWindow* GetActiveWindow() = 0; 146 virtual WmWindow* GetActiveWindow() = 0;
142 147
143 virtual WmWindow* GetPrimaryRootWindow() = 0; 148 virtual WmWindow* GetPrimaryRootWindow() = 0;
144 149
145 // Returns the root window for the specified display. 150 // Returns the root window for the specified display.
146 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0; 151 virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0;
147 152
148 // Returns the root window that newly created windows should be added to. 153 // Returns the root window that newly created windows should be added to.
154 // Value can be temporarily overridden using ScopedRootWindowForNewWindows.
149 // NOTE: this returns the root, newly created window should be added to the 155 // NOTE: this returns the root, newly created window should be added to the
150 // appropriate container in the returned window. 156 // appropriate container in the returned window.
151 virtual WmWindow* GetRootWindowForNewWindows() = 0; 157 WmWindow* GetRootWindowForNewWindows();
152 158
153 // Retuns the display info associated with |display_id|. 159 // Retuns the display info associated with |display_id|.
154 // TODO(msw): Remove this when DisplayManager has been moved. crbug.com/622480 160 // TODO(msw): Remove this when DisplayManager has been moved. crbug.com/622480
155 virtual const DisplayInfo& GetDisplayInfo(int64_t display_id) const = 0; 161 virtual const DisplayInfo& GetDisplayInfo(int64_t display_id) const = 0;
156 162
157 // Matches that of DisplayManager::IsActiveDisplayId(). 163 // Matches that of DisplayManager::IsActiveDisplayId().
158 // TODO: Remove this when DisplayManager has been moved. crbug.com/622480 164 // TODO: Remove this when DisplayManager has been moved. crbug.com/622480
159 virtual bool IsActiveDisplayId(int64_t display_id) const = 0; 165 virtual bool IsActiveDisplayId(int64_t display_id) const = 0;
160 166
161 // Returns true if the first window shown on first run should be 167 // Returns true if the first window shown on first run should be
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 void CreateMruWindowTracker(); 320 void CreateMruWindowTracker();
315 void DeleteMruWindowTracker(); 321 void DeleteMruWindowTracker();
316 322
317 void DeleteToastManager(); 323 void DeleteToastManager();
318 324
319 void SetAcceleratorController( 325 void SetAcceleratorController(
320 std::unique_ptr<AcceleratorController> accelerator_controller); 326 std::unique_ptr<AcceleratorController> accelerator_controller);
321 327
322 private: 328 private:
323 friend class AcceleratorControllerTest; 329 friend class AcceleratorControllerTest;
330 friend class ScopedRootWindowForNewWindows;
324 friend class Shell; 331 friend class Shell;
325 332
326 static WmShell* instance_; 333 static WmShell* instance_;
327 334
328 base::ObserverList<ShellObserver> shell_observers_; 335 base::ObserverList<ShellObserver> shell_observers_;
329 std::unique_ptr<ShellDelegate> delegate_; 336 std::unique_ptr<ShellDelegate> delegate_;
330 337
331 std::unique_ptr<AcceleratorController> accelerator_controller_; 338 std::unique_ptr<AcceleratorController> accelerator_controller_;
332 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; 339 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
333 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; 340 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
334 std::unique_ptr<FocusCycler> focus_cycler_; 341 std::unique_ptr<FocusCycler> focus_cycler_;
335 std::unique_ptr<KeyboardBrightnessControlDelegate> 342 std::unique_ptr<KeyboardBrightnessControlDelegate>
336 keyboard_brightness_control_delegate_; 343 keyboard_brightness_control_delegate_;
337 std::unique_ptr<KeyboardUI> keyboard_ui_; 344 std::unique_ptr<KeyboardUI> keyboard_ui_;
338 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; 345 std::unique_ptr<MaximizeModeController> maximize_mode_controller_;
339 std::unique_ptr<MediaDelegate> media_delegate_; 346 std::unique_ptr<MediaDelegate> media_delegate_;
340 std::unique_ptr<MruWindowTracker> mru_window_tracker_; 347 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
341 std::unique_ptr<NewWindowDelegate> new_window_delegate_; 348 std::unique_ptr<NewWindowDelegate> new_window_delegate_;
342 std::unique_ptr<ShelfDelegate> shelf_delegate_; 349 std::unique_ptr<ShelfDelegate> shelf_delegate_;
343 std::unique_ptr<ShelfModel> shelf_model_; 350 std::unique_ptr<ShelfModel> shelf_model_;
344 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; 351 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
345 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; 352 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
346 std::unique_ptr<ToastManager> toast_manager_; 353 std::unique_ptr<ToastManager> toast_manager_;
347 std::unique_ptr<WindowCycleController> window_cycle_controller_; 354 std::unique_ptr<WindowCycleController> window_cycle_controller_;
348 std::unique_ptr<WindowSelectorController> window_selector_controller_; 355 std::unique_ptr<WindowSelectorController> window_selector_controller_;
349 356
350 base::ObserverList<LockStateObserver> lock_state_observers_; 357 base::ObserverList<LockStateObserver> lock_state_observers_;
351 358
359 // See comment for GetRootWindowForNewWindows().
360 WmWindow* root_window_for_new_windows_ = nullptr;
361 WmWindow* scoped_root_window_for_new_windows_ = nullptr;
362
352 bool simulate_modal_window_open_for_testing_ = false; 363 bool simulate_modal_window_open_for_testing_ = false;
353 364
354 #if defined(OS_CHROMEOS) 365 #if defined(OS_CHROMEOS)
355 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; 366 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
356 #endif 367 #endif
357 }; 368 };
358 369
359 } // namespace ash 370 } // namespace ash
360 371
361 #endif // ASH_COMMON_WM_SHELL_H_ 372 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/scoped_root_window_for_new_windows.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698