| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 | 25 |
| 26 class AccessibilityDelegate; | 26 class AccessibilityDelegate; |
| 27 class FocusCycler; | 27 class FocusCycler; |
| 28 class MruWindowTracker; | 28 class MruWindowTracker; |
| 29 class SessionStateDelegate; | 29 class SessionStateDelegate; |
| 30 class ShellObserver; | 30 class ShellObserver; |
| 31 class SystemTrayDelegate; | 31 class SystemTrayDelegate; |
| 32 class WindowResizer; | 32 class WindowResizer; |
| 33 class WindowSelectorController; |
| 33 class WmActivationObserver; | 34 class WmActivationObserver; |
| 34 class WmDisplayObserver; | 35 class WmDisplayObserver; |
| 35 class WmSystemTrayNotifier; | 36 class WmSystemTrayNotifier; |
| 36 class WmWindow; | 37 class WmWindow; |
| 37 | 38 |
| 38 namespace wm { | 39 namespace wm { |
| 39 class WindowState; | 40 class WindowState; |
| 40 } | 41 } |
| 41 | 42 |
| 42 // Similar to ash::Shell. Eventually the two will be merged. | 43 // Similar to ash::Shell. Eventually the two will be merged. |
| 43 class ASH_EXPORT WmShell { | 44 class ASH_EXPORT WmShell { |
| 44 public: | 45 public: |
| 45 // This is necessary for a handful of places that is difficult to plumb | 46 // This is necessary for a handful of places that is difficult to plumb |
| 46 // through context. | 47 // through context. |
| 47 static void Set(WmShell* instance); | 48 static void Set(WmShell* instance); |
| 48 static WmShell* Get(); | 49 static WmShell* Get(); |
| 49 static bool HasInstance() { return instance_ != nullptr; } | 50 static bool HasInstance() { return instance_ != nullptr; } |
| 50 | 51 |
| 51 FocusCycler* focus_cycler() { return focus_cycler_.get(); } | 52 FocusCycler* focus_cycler() { return focus_cycler_.get(); } |
| 52 | 53 |
| 53 WmSystemTrayNotifier* system_tray_notifier() { | 54 WmSystemTrayNotifier* system_tray_notifier() { |
| 54 return system_tray_notifier_.get(); | 55 return system_tray_notifier_.get(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 SystemTrayDelegate* system_tray_delegate() { | 58 SystemTrayDelegate* system_tray_delegate() { |
| 58 return system_tray_delegate_.get(); | 59 return system_tray_delegate_.get(); |
| 59 } | 60 } |
| 60 | 61 |
| 62 WindowSelectorController* window_selector_controller() { |
| 63 return window_selector_controller_.get(); |
| 64 } |
| 65 |
| 61 virtual MruWindowTracker* GetMruWindowTracker() = 0; | 66 virtual MruWindowTracker* GetMruWindowTracker() = 0; |
| 62 | 67 |
| 63 // Creates a new window used as a container of other windows. No painting is | 68 // Creates a new window used as a container of other windows. No painting is |
| 64 // done to the created window. | 69 // done to the created window. |
| 65 virtual WmWindow* NewContainerWindow() = 0; | 70 virtual WmWindow* NewContainerWindow() = 0; |
| 66 | 71 |
| 67 virtual WmWindow* GetFocusedWindow() = 0; | 72 virtual WmWindow* GetFocusedWindow() = 0; |
| 68 virtual WmWindow* GetActiveWindow() = 0; | 73 virtual WmWindow* GetActiveWindow() = 0; |
| 69 | 74 |
| 70 virtual WmWindow* GetPrimaryRootWindow() = 0; | 75 virtual WmWindow* GetPrimaryRootWindow() = 0; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 std::unique_ptr<WindowResizer> next_window_resizer, | 129 std::unique_ptr<WindowResizer> next_window_resizer, |
| 125 wm::WindowState* window_state) = 0; | 130 wm::WindowState* window_state) = 0; |
| 126 | 131 |
| 127 // Called when the overview mode is about to be started (before the windows | 132 // Called when the overview mode is about to be started (before the windows |
| 128 // get re-arranged). | 133 // get re-arranged). |
| 129 virtual void OnOverviewModeStarting() = 0; | 134 virtual void OnOverviewModeStarting() = 0; |
| 130 | 135 |
| 131 // Called after overview mode has ended. | 136 // Called after overview mode has ended. |
| 132 virtual void OnOverviewModeEnded() = 0; | 137 virtual void OnOverviewModeEnded() = 0; |
| 133 | 138 |
| 134 // TODO(sky): if WindowSelectorController can't be moved over, move these | |
| 135 // onto their own local class. | |
| 136 virtual bool IsOverviewModeSelecting() = 0; | |
| 137 virtual bool IsOverviewModeRestoringMinimizedWindows() = 0; | |
| 138 | |
| 139 virtual AccessibilityDelegate* GetAccessibilityDelegate() = 0; | 139 virtual AccessibilityDelegate* GetAccessibilityDelegate() = 0; |
| 140 | 140 |
| 141 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; | 141 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; |
| 142 | 142 |
| 143 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; | 143 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; |
| 144 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; | 144 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; |
| 145 | 145 |
| 146 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; | 146 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; |
| 147 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; | 147 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; |
| 148 | 148 |
| 149 virtual void AddShellObserver(ShellObserver* observer) = 0; | 149 virtual void AddShellObserver(ShellObserver* observer) = 0; |
| 150 virtual void RemoveShellObserver(ShellObserver* observer) = 0; | 150 virtual void RemoveShellObserver(ShellObserver* observer) = 0; |
| 151 | 151 |
| 152 virtual void AddPointerWatcher(views::PointerWatcher* watcher) = 0; | 152 virtual void AddPointerWatcher(views::PointerWatcher* watcher) = 0; |
| 153 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; | 153 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; |
| 154 | 154 |
| 155 #if defined(OS_CHROMEOS) | 155 #if defined(OS_CHROMEOS) |
| 156 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. | 156 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. |
| 157 virtual void ToggleIgnoreExternalKeyboard() = 0; | 157 virtual void ToggleIgnoreExternalKeyboard() = 0; |
| 158 #endif | 158 #endif |
| 159 | 159 |
| 160 protected: | 160 protected: |
| 161 WmShell(); | 161 WmShell(); |
| 162 virtual ~WmShell(); | 162 virtual ~WmShell(); |
| 163 | 163 |
| 164 // If |delegate| is not null, sets and initializes the delegate. If |delegate| | 164 // If |delegate| is not null, sets and initializes the delegate. If |delegate| |
| 165 // is null, shuts down and destroys the delegate. | 165 // is null, shuts down and destroys the delegate. |
| 166 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 166 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
| 167 | 167 |
| 168 void DeleteWindowSelectorController(); |
| 169 |
| 168 private: | 170 private: |
| 169 friend class Shell; | 171 friend class Shell; |
| 170 | 172 |
| 171 static WmShell* instance_; | 173 static WmShell* instance_; |
| 172 | 174 |
| 173 std::unique_ptr<FocusCycler> focus_cycler_; | 175 std::unique_ptr<FocusCycler> focus_cycler_; |
| 174 std::unique_ptr<WmSystemTrayNotifier> system_tray_notifier_; | 176 std::unique_ptr<WmSystemTrayNotifier> system_tray_notifier_; |
| 175 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 177 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
| 178 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
| 176 | 179 |
| 177 bool simulate_modal_window_open_for_testing_ = false; | 180 bool simulate_modal_window_open_for_testing_ = false; |
| 178 }; | 181 }; |
| 179 | 182 |
| 180 } // namespace ash | 183 } // namespace ash |
| 181 | 184 |
| 182 #endif // ASH_COMMON_WM_SHELL_H_ | 185 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |