| 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/gesture_action_type.h" | 14 #include "ash/common/metrics/gesture_action_type.h" |
| 15 #include "ash/common/metrics/user_metrics_action.h" | 15 #include "ash/common/metrics/user_metrics_action.h" |
| 16 #include "ash/common/session/session_state_observer.h" | 16 #include "ash/common/session/session_state_observer.h" |
| 17 #include "ash/common/wm/lock_state_observer.h" | 17 #include "ash/common/wm/lock_state_observer.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "ui/base/ui_base_types.h" | 19 #include "ui/base/ui_base_types.h" |
| 20 #include "ui/compositor/layer_type.h" | 20 #include "ui/compositor/layer_type.h" |
| 21 #include "ui/wm/public/activation_change_observer.h" | 21 #include "ui/wm/public/activation_change_observer.h" |
| 22 #include "ui/wm/public/window_types.h" | 22 #include "ui/wm/public/window_types.h" |
| 23 | 23 |
| 24 namespace app_list { | |
| 25 class AppList; | |
| 26 } | |
| 27 | |
| 28 namespace display { | 24 namespace display { |
| 29 class Display; | 25 class Display; |
| 30 class ManagedDisplayInfo; | 26 class ManagedDisplayInfo; |
| 31 } | 27 } |
| 32 | 28 |
| 33 namespace gfx { | 29 namespace gfx { |
| 34 class Insets; | 30 class Insets; |
| 35 class Point; | 31 class Point; |
| 36 } | 32 } |
| 37 | 33 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 89 |
| 94 static WmShell* Get(); | 90 static WmShell* Get(); |
| 95 static bool HasInstance() { return instance_ != nullptr; } | 91 static bool HasInstance() { return instance_ != nullptr; } |
| 96 | 92 |
| 97 virtual void Shutdown(); | 93 virtual void Shutdown(); |
| 98 | 94 |
| 99 AcceleratorController* accelerator_controller() { | 95 AcceleratorController* accelerator_controller() { |
| 100 return accelerator_controller_.get(); | 96 return accelerator_controller_.get(); |
| 101 } | 97 } |
| 102 | 98 |
| 103 app_list::AppList* app_list() { return app_list_.get(); } | |
| 104 | |
| 105 BrightnessControlDelegate* brightness_control_delegate() { | 99 BrightnessControlDelegate* brightness_control_delegate() { |
| 106 return brightness_control_delegate_.get(); | 100 return brightness_control_delegate_.get(); |
| 107 } | 101 } |
| 108 | 102 |
| 109 CastConfigController* cast_config() { return cast_config_.get(); } | 103 CastConfigController* cast_config() { return cast_config_.get(); } |
| 110 | 104 |
| 111 FocusCycler* focus_cycler() { return focus_cycler_.get(); } | 105 FocusCycler* focus_cycler() { return focus_cycler_.get(); } |
| 112 | 106 |
| 113 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { | 107 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { |
| 114 return keyboard_brightness_control_delegate_.get(); | 108 return keyboard_brightness_control_delegate_.get(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 221 |
| 228 // Called when a modal window is removed. It will activate another modal | 222 // Called when a modal window is removed. It will activate another modal |
| 229 // window if any, or remove modal screens on all displays. | 223 // window if any, or remove modal screens on all displays. |
| 230 void OnModalWindowRemoved(WmWindow* removed); | 224 void OnModalWindowRemoved(WmWindow* removed); |
| 231 | 225 |
| 232 // For testing only: set simulation that a modal window is open | 226 // For testing only: set simulation that a modal window is open |
| 233 void SimulateModalWindowOpenForTesting(bool modal_window_open) { | 227 void SimulateModalWindowOpenForTesting(bool modal_window_open) { |
| 234 simulate_modal_window_open_for_testing_ = modal_window_open; | 228 simulate_modal_window_open_for_testing_ = modal_window_open; |
| 235 } | 229 } |
| 236 | 230 |
| 237 // Shows the app list on the active root window. | |
| 238 void ShowAppList(); | |
| 239 | |
| 240 // Dismisses the app list. | |
| 241 void DismissAppList(); | |
| 242 | |
| 243 // Shows the app list if it's not visible. Dismisses it otherwise. | |
| 244 void ToggleAppList(); | |
| 245 | |
| 246 // Returns app list actual visibility. This might differ from | |
| 247 // GetAppListTargetVisibility() when hiding animation is still in flight. | |
| 248 bool IsApplistVisible() const; | |
| 249 | |
| 250 // Returns app list target visibility. | |
| 251 bool GetAppListTargetVisibility() const; | |
| 252 | |
| 253 // Returns true if a window is currently pinned. | 231 // Returns true if a window is currently pinned. |
| 254 virtual bool IsPinned() = 0; | 232 virtual bool IsPinned() = 0; |
| 255 | 233 |
| 256 // Sets/Unsets the |window| to as a pinned window. If this is called with a | 234 // Sets/Unsets the |window| to as a pinned window. If this is called with a |
| 257 // window with WINDOW_STATE_TYPE_PINNED state, then this sets the |window| | 235 // window with WINDOW_STATE_TYPE_PINNED state, then this sets the |window| |
| 258 // as a pinned window. Otherwise, this unsets it. | 236 // as a pinned window. Otherwise, this unsets it. |
| 259 // For setting, a caller needs to guarantee that no windows are set | 237 // For setting, a caller needs to guarantee that no windows are set |
| 260 // as pinned window. For unsetting, a caller needs to guarantee that the | 238 // as pinned window. For unsetting, a caller needs to guarantee that the |
| 261 // |window| is the one which is currently set as a pinned window via previous | 239 // |window| is the one which is currently set as a pinned window via previous |
| 262 // this function invocation. | 240 // this function invocation. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 void SessionStateChanged(session_manager::SessionState state) override; | 357 void SessionStateChanged(session_manager::SessionState state) override; |
| 380 | 358 |
| 381 private: | 359 private: |
| 382 friend class AcceleratorControllerTest; | 360 friend class AcceleratorControllerTest; |
| 383 friend class Shell; | 361 friend class Shell; |
| 384 friend class WmShellTestApi; | 362 friend class WmShellTestApi; |
| 385 | 363 |
| 386 static WmShell* instance_; | 364 static WmShell* instance_; |
| 387 | 365 |
| 388 std::unique_ptr<AcceleratorController> accelerator_controller_; | 366 std::unique_ptr<AcceleratorController> accelerator_controller_; |
| 389 std::unique_ptr<app_list::AppList> app_list_; | |
| 390 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; | 367 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; |
| 391 std::unique_ptr<CastConfigController> cast_config_; | 368 std::unique_ptr<CastConfigController> cast_config_; |
| 392 std::unique_ptr<FocusCycler> focus_cycler_; | 369 std::unique_ptr<FocusCycler> focus_cycler_; |
| 393 std::unique_ptr<ImmersiveContextAsh> immersive_context_; | 370 std::unique_ptr<ImmersiveContextAsh> immersive_context_; |
| 394 std::unique_ptr<KeyboardBrightnessControlDelegate> | 371 std::unique_ptr<KeyboardBrightnessControlDelegate> |
| 395 keyboard_brightness_control_delegate_; | 372 keyboard_brightness_control_delegate_; |
| 396 std::unique_ptr<KeyboardUI> keyboard_ui_; | 373 std::unique_ptr<KeyboardUI> keyboard_ui_; |
| 397 std::unique_ptr<LocaleNotificationController> locale_notification_controller_; | 374 std::unique_ptr<LocaleNotificationController> locale_notification_controller_; |
| 398 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; | 375 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
| 399 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; | 376 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 413 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 390 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
| 414 | 391 |
| 415 base::ObserverList<LockStateObserver> lock_state_observers_; | 392 base::ObserverList<LockStateObserver> lock_state_observers_; |
| 416 | 393 |
| 417 bool simulate_modal_window_open_for_testing_ = false; | 394 bool simulate_modal_window_open_for_testing_ = false; |
| 418 }; | 395 }; |
| 419 | 396 |
| 420 } // namespace ash | 397 } // namespace ash |
| 421 | 398 |
| 422 #endif // ASH_COMMON_WM_SHELL_H_ | 399 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |