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

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

Issue 2103053004: mash: Convert virtual keyboard system tray item to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak Created 4 years, 5 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
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>
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 15
16 namespace gfx { 16 namespace gfx {
17 class Rect; 17 class Rect;
18 } 18 }
19 19
20 namespace views { 20 namespace views {
21 class PointerWatcher; 21 class PointerWatcher;
22 } 22 }
23 23
24 namespace ash { 24 namespace ash {
25 25
26 class AccessibilityDelegate; 26 class AccessibilityDelegate;
27 class DisplayInfo; 27 class DisplayInfo;
28 class FocusCycler; 28 class FocusCycler;
29 class KeyboardUI;
29 class MruWindowTracker; 30 class MruWindowTracker;
30 class SessionStateDelegate; 31 class SessionStateDelegate;
31 class ShellObserver; 32 class ShellObserver;
32 class SystemTrayDelegate; 33 class SystemTrayDelegate;
33 class WindowResizer; 34 class WindowResizer;
34 class WindowSelectorController; 35 class WindowSelectorController;
35 class WmActivationObserver; 36 class WmActivationObserver;
36 class WmDisplayObserver; 37 class WmDisplayObserver;
37 class SystemTrayNotifier; 38 class SystemTrayNotifier;
38 class WmWindow; 39 class WmWindow;
39 40
40 namespace wm { 41 namespace wm {
41 class WindowState; 42 class WindowState;
42 } 43 }
43 44
44 // Similar to ash::Shell. Eventually the two will be merged. 45 // Similar to ash::Shell. Eventually the two will be merged.
45 class ASH_EXPORT WmShell { 46 class ASH_EXPORT WmShell {
46 public: 47 public:
47 // This is necessary for a handful of places that is difficult to plumb 48 // This is necessary for a handful of places that is difficult to plumb
48 // through context. 49 // through context.
49 static void Set(WmShell* instance); 50 static void Set(WmShell* instance);
50 static WmShell* Get(); 51 static WmShell* Get();
51 static bool HasInstance() { return instance_ != nullptr; } 52 static bool HasInstance() { return instance_ != nullptr; }
52 53
53 FocusCycler* focus_cycler() { return focus_cycler_.get(); } 54 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
54 55
56 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
57
55 SystemTrayNotifier* system_tray_notifier() { 58 SystemTrayNotifier* system_tray_notifier() {
56 return system_tray_notifier_.get(); 59 return system_tray_notifier_.get();
57 } 60 }
58 61
59 SystemTrayDelegate* system_tray_delegate() { 62 SystemTrayDelegate* system_tray_delegate() {
60 return system_tray_delegate_.get(); 63 return system_tray_delegate_.get();
61 } 64 }
62 65
63 WindowSelectorController* window_selector_controller() { 66 WindowSelectorController* window_selector_controller() {
64 return window_selector_controller_.get(); 67 return window_selector_controller_.get();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 161
159 #if defined(OS_CHROMEOS) 162 #if defined(OS_CHROMEOS)
160 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. 163 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved.
161 virtual void ToggleIgnoreExternalKeyboard() = 0; 164 virtual void ToggleIgnoreExternalKeyboard() = 0;
162 #endif 165 #endif
163 166
164 protected: 167 protected:
165 WmShell(); 168 WmShell();
166 virtual ~WmShell(); 169 virtual ~WmShell();
167 170
171 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui);
172
168 // If |delegate| is not null, sets and initializes the delegate. If |delegate| 173 // If |delegate| is not null, sets and initializes the delegate. If |delegate|
169 // is null, shuts down and destroys the delegate. 174 // is null, shuts down and destroys the delegate.
170 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); 175 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate);
171 176
172 void DeleteWindowSelectorController(); 177 void DeleteWindowSelectorController();
173 178
174 private: 179 private:
175 friend class Shell; 180 friend class Shell;
176 181
177 static WmShell* instance_; 182 static WmShell* instance_;
178 183
179 std::unique_ptr<FocusCycler> focus_cycler_; 184 std::unique_ptr<FocusCycler> focus_cycler_;
185 std::unique_ptr<KeyboardUI> keyboard_ui_;
180 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; 186 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
181 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; 187 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
182 std::unique_ptr<WindowSelectorController> window_selector_controller_; 188 std::unique_ptr<WindowSelectorController> window_selector_controller_;
183 189
184 bool simulate_modal_window_open_for_testing_ = false; 190 bool simulate_modal_window_open_for_testing_ = false;
185 }; 191 };
186 192
187 } // namespace ash 193 } // namespace ash
188 194
189 #endif // ASH_COMMON_WM_SHELL_H_ 195 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698