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_WM_SHELL_H_ | 5 #ifndef ASH_SHELL_PORT_H_ |
6 #define ASH_WM_SHELL_H_ | 6 #define ASH_SHELL_PORT_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/metrics/gesture_action_type.h" | 14 #include "ash/metrics/gesture_action_type.h" |
15 #include "ash/metrics/user_metrics_action.h" | 15 #include "ash/metrics/user_metrics_action.h" |
16 #include "ash/wm/lock_state_observer.h" | 16 #include "ash/wm/lock_state_observer.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 enum class Config; | 53 enum class Config; |
54 enum class LoginStatus; | 54 enum class LoginStatus; |
55 enum class TaskSwitchSource; | 55 enum class TaskSwitchSource; |
56 | 56 |
57 namespace wm { | 57 namespace wm { |
58 class MaximizeModeEventHandler; | 58 class MaximizeModeEventHandler; |
59 class WindowState; | 59 class WindowState; |
60 } | 60 } |
61 | 61 |
62 // Similar to ash::Shell. Eventually the two will be merged. | 62 // Porting layer for Shell. This class contains the part of Shell that are |
63 class ASH_EXPORT WmShell { | 63 // different in classic ash and mus/mash. |
| 64 class ASH_EXPORT ShellPort { |
64 public: | 65 public: |
65 virtual ~WmShell(); | 66 virtual ~ShellPort(); |
66 | 67 |
67 static WmShell* Get(); | 68 static ShellPort* Get(); |
68 static bool HasInstance() { return instance_ != nullptr; } | 69 static bool HasInstance() { return instance_ != nullptr; } |
69 | 70 |
70 virtual void Shutdown(); | 71 virtual void Shutdown(); |
71 | 72 |
72 // Returns true when ash is running as a service_manager::Service. | 73 // Returns true when ash is running as a service_manager::Service. |
73 // TODO(sky): remove and convert to GetAshConfig(). | 74 // TODO(sky): remove and convert to GetAshConfig(). |
74 virtual bool IsRunningInMash() const = 0; | 75 virtual bool IsRunningInMash() const = 0; |
75 virtual Config GetAshConfig() const = 0; | 76 virtual Config GetAshConfig() const = 0; |
76 | 77 |
77 // Convenience for GetPrimaryRootWindow()->GetRootWindowController(). | 78 // Convenience for GetPrimaryRootWindow()->GetRootWindowController(). |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 201 |
201 // Enable or disable the laser pointer. | 202 // Enable or disable the laser pointer. |
202 virtual void SetLaserPointerEnabled(bool enabled) = 0; | 203 virtual void SetLaserPointerEnabled(bool enabled) = 0; |
203 | 204 |
204 // Enable or disable the partial magnifier. | 205 // Enable or disable the partial magnifier. |
205 virtual void SetPartialMagnifierEnabled(bool enabled) = 0; | 206 virtual void SetPartialMagnifierEnabled(bool enabled) = 0; |
206 | 207 |
207 virtual void CreatePointerWatcherAdapter() = 0; | 208 virtual void CreatePointerWatcherAdapter() = 0; |
208 | 209 |
209 protected: | 210 protected: |
210 WmShell(); | 211 ShellPort(); |
211 | 212 |
212 // Called during startup to create the primary WindowTreeHost and | 213 // Called during startup to create the primary WindowTreeHost and |
213 // the corresponding RootWindowController. | 214 // the corresponding RootWindowController. |
214 virtual void CreatePrimaryHost() = 0; | 215 virtual void CreatePrimaryHost() = 0; |
215 virtual void InitHosts(const ShellInitParams& init_params) = 0; | 216 virtual void InitHosts(const ShellInitParams& init_params) = 0; |
216 | 217 |
217 // Called during startup to create the AcceleratorController. | 218 // Called during startup to create the AcceleratorController. |
218 virtual std::unique_ptr<AcceleratorController> | 219 virtual std::unique_ptr<AcceleratorController> |
219 CreateAcceleratorController() = 0; | 220 CreateAcceleratorController() = 0; |
220 | 221 |
221 private: | 222 private: |
222 friend class AcceleratorControllerTest; | 223 friend class AcceleratorControllerTest; |
223 friend class Shell; | 224 friend class Shell; |
224 | 225 |
225 static WmShell* instance_; | 226 static ShellPort* instance_; |
226 | 227 |
227 base::ObserverList<LockStateObserver> lock_state_observers_; | 228 base::ObserverList<LockStateObserver> lock_state_observers_; |
228 | 229 |
229 bool simulate_modal_window_open_for_testing_ = false; | 230 bool simulate_modal_window_open_for_testing_ = false; |
230 }; | 231 }; |
231 | 232 |
232 } // namespace ash | 233 } // namespace ash |
233 | 234 |
234 #endif // ASH_WM_SHELL_H_ | 235 #endif // ASH_SHELL_PORT_H_ |
OLD | NEW |