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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "ash/ash_export.h" | 13 #include "ash/ash_export.h" |
14 #include "ash/common/metrics/user_metrics_action.h" | 14 #include "ash/common/metrics/user_metrics_action.h" |
15 #include "base/observer_list.h" | |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 class Rect; | 18 class Rect; |
18 } | 19 } |
19 | 20 |
20 namespace views { | 21 namespace views { |
21 class PointerWatcher; | 22 class PointerWatcher; |
22 } | 23 } |
23 | 24 |
24 namespace ash { | 25 namespace ash { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 } | 67 } |
67 | 68 |
68 SystemTrayDelegate* system_tray_delegate() { | 69 SystemTrayDelegate* system_tray_delegate() { |
69 return system_tray_delegate_.get(); | 70 return system_tray_delegate_.get(); |
70 } | 71 } |
71 | 72 |
72 WindowSelectorController* window_selector_controller() { | 73 WindowSelectorController* window_selector_controller() { |
73 return window_selector_controller_.get(); | 74 return window_selector_controller_.get(); |
74 } | 75 } |
75 | 76 |
76 virtual MruWindowTracker* GetMruWindowTracker() = 0; | 77 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } |
James Cook
2016/06/30 21:29:20
nit: put after keyboard_ui (I'm trying to keep the
sky
2016/06/30 21:49:41
Done, but similar comment to what I say below.
| |
77 | 78 |
78 // Creates a new window used as a container of other windows. No painting is | 79 // Creates a new window used as a container of other windows. No painting is |
79 // done to the created window. | 80 // done to the created window. |
80 virtual WmWindow* NewContainerWindow() = 0; | 81 virtual WmWindow* NewContainerWindow() = 0; |
81 | 82 |
82 virtual WmWindow* GetFocusedWindow() = 0; | 83 virtual WmWindow* GetFocusedWindow() = 0; |
83 virtual WmWindow* GetActiveWindow() = 0; | 84 virtual WmWindow* GetActiveWindow() = 0; |
84 | 85 |
85 virtual WmWindow* GetPrimaryRootWindow() = 0; | 86 virtual WmWindow* GetPrimaryRootWindow() = 0; |
86 | 87 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 virtual std::unique_ptr<wm::MaximizeModeEventHandler> | 146 virtual std::unique_ptr<wm::MaximizeModeEventHandler> |
146 CreateMaximizeModeEventHandler() = 0; | 147 CreateMaximizeModeEventHandler() = 0; |
147 | 148 |
148 // Called when the overview mode is about to be started (before the windows | 149 // Called when the overview mode is about to be started (before the windows |
149 // get re-arranged). | 150 // get re-arranged). |
150 virtual void OnOverviewModeStarting() = 0; | 151 virtual void OnOverviewModeStarting() = 0; |
151 | 152 |
152 // Called after overview mode has ended. | 153 // Called after overview mode has ended. |
153 virtual void OnOverviewModeEnded() = 0; | 154 virtual void OnOverviewModeEnded() = 0; |
154 | 155 |
156 // Notifies |observers_| when entering or exiting pinned mode for | |
157 // |pinned_window|. Entering or exiting can be checked by looking at | |
158 // |pinned_window|'s window state. | |
159 void NotifyPinnedStateChanged(WmWindow* pinned_window); | |
160 | |
155 virtual AccessibilityDelegate* GetAccessibilityDelegate() = 0; | 161 virtual AccessibilityDelegate* GetAccessibilityDelegate() = 0; |
156 | 162 |
157 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; | 163 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; |
158 | 164 |
159 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; | 165 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; |
160 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; | 166 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; |
161 | 167 |
162 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; | 168 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; |
163 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; | 169 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; |
164 | 170 |
165 virtual void AddShellObserver(ShellObserver* observer) = 0; | 171 void AddShellObserver(ShellObserver* observer); |
166 virtual void RemoveShellObserver(ShellObserver* observer) = 0; | 172 void RemoveShellObserver(ShellObserver* observer); |
167 | 173 |
168 virtual void AddPointerWatcher(views::PointerWatcher* watcher) = 0; | 174 virtual void AddPointerWatcher(views::PointerWatcher* watcher) = 0; |
169 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; | 175 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; |
170 | 176 |
171 #if defined(OS_CHROMEOS) | 177 #if defined(OS_CHROMEOS) |
172 LogoutConfirmationController* logout_confirmation_controller() { | 178 LogoutConfirmationController* logout_confirmation_controller() { |
173 return logout_confirmation_controller_.get(); | 179 return logout_confirmation_controller_.get(); |
174 } | 180 } |
175 | 181 |
176 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. | 182 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. |
177 virtual void ToggleIgnoreExternalKeyboard() = 0; | 183 virtual void ToggleIgnoreExternalKeyboard() = 0; |
178 #endif | 184 #endif |
179 | 185 |
180 protected: | 186 protected: |
181 WmShell(); | 187 WmShell(); |
182 virtual ~WmShell(); | 188 virtual ~WmShell(); |
183 | 189 |
184 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); | 190 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); |
185 | 191 |
192 base::ObserverList<ShellObserver>* shell_observers() { | |
James Cook
2016/06/30 21:29:20
nit: simple getter above SetKeyboardUI
sky
2016/06/30 21:49:41
Done. I will add though that sort of style is more
| |
193 return &shell_observers_; | |
194 } | |
195 | |
186 // Sets and initializes the |delegate|. | 196 // Sets and initializes the |delegate|. |
187 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 197 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
188 void DeleteSystemTrayDelegate(); | 198 void DeleteSystemTrayDelegate(); |
189 | 199 |
190 void DeleteWindowSelectorController(); | 200 void DeleteWindowSelectorController(); |
191 | 201 |
202 void CreateMruWindowTracker(); | |
203 void DeleteMruWindowTracker(); | |
204 | |
192 private: | 205 private: |
193 friend class Shell; | 206 friend class Shell; |
194 | 207 |
195 static WmShell* instance_; | 208 static WmShell* instance_; |
196 | 209 |
210 base::ObserverList<ShellObserver> shell_observers_; | |
211 | |
197 std::unique_ptr<FocusCycler> focus_cycler_; | 212 std::unique_ptr<FocusCycler> focus_cycler_; |
198 std::unique_ptr<KeyboardUI> keyboard_ui_; | 213 std::unique_ptr<KeyboardUI> keyboard_ui_; |
199 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; | 214 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
200 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 215 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
201 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 216 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
202 | 217 |
203 bool simulate_modal_window_open_for_testing_ = false; | 218 bool simulate_modal_window_open_for_testing_ = false; |
204 | 219 |
220 std::unique_ptr<MruWindowTracker> mru_window_tracker_; | |
James Cook
2016/06/30 21:29:20
ditto
sky
2016/06/30 21:49:41
Done, and I'll ditto my nit from above;)
| |
221 | |
205 #if defined(OS_CHROMEOS) | 222 #if defined(OS_CHROMEOS) |
206 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; | 223 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
207 #endif | 224 #endif |
208 }; | 225 }; |
209 | 226 |
210 } // namespace ash | 227 } // namespace ash |
211 | 228 |
212 #endif // ASH_COMMON_WM_SHELL_H_ | 229 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |