| 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 COMPONENTS_EXO_WM_HELPER_H_ | 5 #ifndef COMPONENTS_EXO_WM_HELPER_H_ |
| 6 #define COMPONENTS_EXO_WM_HELPER_H_ | 6 #define COMPONENTS_EXO_WM_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "ui/base/cursor/cursor.h" | 10 #include "ui/base/cursor/cursor.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 class CursorObserver { | 47 class CursorObserver { |
| 48 public: | 48 public: |
| 49 virtual void OnCursorVisibilityChanged(bool is_visible) {} | 49 virtual void OnCursorVisibilityChanged(bool is_visible) {} |
| 50 virtual void OnCursorSetChanged(ui::CursorSetType cursor_set) {} | 50 virtual void OnCursorSetChanged(ui::CursorSetType cursor_set) {} |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 virtual ~CursorObserver() {} | 53 virtual ~CursorObserver() {} |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class MaximizeModeObserver { | 56 class ShellObserver { |
| 57 public: | 57 public: |
| 58 virtual void OnMaximizeModeStarted() = 0; | 58 virtual void OnMaximizeModeStarted() {} |
| 59 virtual void OnMaximizeModeEnded() = 0; | 59 virtual void OnMaximizeModeEnded() {} |
| 60 |
| 61 virtual void OnOverviewModeStarted() {} |
| 62 virtual void OnOverviewModeEnded() {} |
| 60 | 63 |
| 61 protected: | 64 protected: |
| 62 virtual ~MaximizeModeObserver() {} | 65 virtual ~ShellObserver() {} |
| 63 }; | 66 }; |
| 64 | 67 |
| 65 class AccessibilityObserver { | 68 class AccessibilityObserver { |
| 66 public: | 69 public: |
| 67 virtual void OnAccessibilityModeChanged() = 0; | 70 virtual void OnAccessibilityModeChanged() = 0; |
| 68 | 71 |
| 69 protected: | 72 protected: |
| 70 virtual ~AccessibilityObserver() {} | 73 virtual ~AccessibilityObserver() {} |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 class InputDeviceEventObserver { | 76 class InputDeviceEventObserver { |
| 74 public: | 77 public: |
| 75 virtual void OnKeyboardDeviceConfigurationChanged() = 0; | 78 virtual void OnKeyboardDeviceConfigurationChanged() = 0; |
| 76 | 79 |
| 77 protected: | 80 protected: |
| 78 virtual ~InputDeviceEventObserver() {} | 81 virtual ~InputDeviceEventObserver() {} |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 virtual ~WMHelper(); | 84 virtual ~WMHelper(); |
| 82 | 85 |
| 83 static void SetInstance(WMHelper* helper); | 86 static void SetInstance(WMHelper* helper); |
| 84 static WMHelper* GetInstance(); | 87 static WMHelper* GetInstance(); |
| 85 | 88 |
| 86 void AddActivationObserver(ActivationObserver* observer); | 89 void AddActivationObserver(ActivationObserver* observer); |
| 87 void RemoveActivationObserver(ActivationObserver* observer); | 90 void RemoveActivationObserver(ActivationObserver* observer); |
| 88 void AddFocusObserver(FocusObserver* observer); | 91 void AddFocusObserver(FocusObserver* observer); |
| 89 void RemoveFocusObserver(FocusObserver* observer); | 92 void RemoveFocusObserver(FocusObserver* observer); |
| 90 void AddCursorObserver(CursorObserver* observer); | 93 void AddCursorObserver(CursorObserver* observer); |
| 91 void RemoveCursorObserver(CursorObserver* observer); | 94 void RemoveCursorObserver(CursorObserver* observer); |
| 92 void AddMaximizeModeObserver(MaximizeModeObserver* observer); | 95 void AddShellObserver(ShellObserver* observer); |
| 93 void RemoveMaximizeModeObserver(MaximizeModeObserver* observer); | 96 void RemoveShellObserver(ShellObserver* observer); |
| 94 void AddAccessibilityObserver(AccessibilityObserver* observer); | 97 void AddAccessibilityObserver(AccessibilityObserver* observer); |
| 95 void RemoveAccessibilityObserver(AccessibilityObserver* observer); | 98 void RemoveAccessibilityObserver(AccessibilityObserver* observer); |
| 96 void AddInputDeviceEventObserver(InputDeviceEventObserver* observer); | 99 void AddInputDeviceEventObserver(InputDeviceEventObserver* observer); |
| 97 void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer); | 100 void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer); |
| 98 | 101 |
| 99 virtual const display::ManagedDisplayInfo GetDisplayInfo( | 102 virtual const display::ManagedDisplayInfo GetDisplayInfo( |
| 100 int64_t display_id) const = 0; | 103 int64_t display_id) const = 0; |
| 101 virtual aura::Window* GetContainer(int container_id) = 0; | 104 virtual aura::Window* GetContainer(int container_id) = 0; |
| 102 virtual aura::Window* GetActiveWindow() const = 0; | 105 virtual aura::Window* GetActiveWindow() const = 0; |
| 103 virtual aura::Window* GetFocusedWindow() const = 0; | 106 virtual aura::Window* GetFocusedWindow() const = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 115 WMHelper(); | 118 WMHelper(); |
| 116 | 119 |
| 117 void NotifyWindowActivated(aura::Window* gained_active, | 120 void NotifyWindowActivated(aura::Window* gained_active, |
| 118 aura::Window* lost_active); | 121 aura::Window* lost_active); |
| 119 void NotifyWindowFocused(aura::Window* gained_focus, | 122 void NotifyWindowFocused(aura::Window* gained_focus, |
| 120 aura::Window* lost_focus); | 123 aura::Window* lost_focus); |
| 121 void NotifyCursorVisibilityChanged(bool is_visible); | 124 void NotifyCursorVisibilityChanged(bool is_visible); |
| 122 void NotifyCursorSetChanged(ui::CursorSetType cursor_set); | 125 void NotifyCursorSetChanged(ui::CursorSetType cursor_set); |
| 123 void NotifyMaximizeModeStarted(); | 126 void NotifyMaximizeModeStarted(); |
| 124 void NotifyMaximizeModeEnded(); | 127 void NotifyMaximizeModeEnded(); |
| 128 void NotifyOverviewModeStarted(); |
| 129 void NotifyOverviewModeEnded(); |
| 125 void NotifyAccessibilityModeChanged(); | 130 void NotifyAccessibilityModeChanged(); |
| 126 void NotifyKeyboardDeviceConfigurationChanged(); | 131 void NotifyKeyboardDeviceConfigurationChanged(); |
| 127 | 132 |
| 128 private: | 133 private: |
| 129 base::ObserverList<ActivationObserver> activation_observers_; | 134 base::ObserverList<ActivationObserver> activation_observers_; |
| 130 base::ObserverList<FocusObserver> focus_observers_; | 135 base::ObserverList<FocusObserver> focus_observers_; |
| 131 base::ObserverList<CursorObserver> cursor_observers_; | 136 base::ObserverList<CursorObserver> cursor_observers_; |
| 132 base::ObserverList<MaximizeModeObserver> maximize_mode_observers_; | 137 base::ObserverList<ShellObserver> shell_observers_; |
| 133 base::ObserverList<AccessibilityObserver> accessibility_observers_; | 138 base::ObserverList<AccessibilityObserver> accessibility_observers_; |
| 134 base::ObserverList<InputDeviceEventObserver> input_device_event_observers_; | 139 base::ObserverList<InputDeviceEventObserver> input_device_event_observers_; |
| 135 | 140 |
| 136 DISALLOW_COPY_AND_ASSIGN(WMHelper); | 141 DISALLOW_COPY_AND_ASSIGN(WMHelper); |
| 137 }; | 142 }; |
| 138 | 143 |
| 139 } // namespace exo | 144 } // namespace exo |
| 140 | 145 |
| 141 #endif // COMPONENTS_EXO_WM_HELPER_H_ | 146 #endif // COMPONENTS_EXO_WM_HELPER_H_ |
| OLD | NEW |