| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class AccessibilityObserver { | 65 class AccessibilityObserver { |
| 66 public: | 66 public: |
| 67 virtual void OnAccessibilityModeChanged() = 0; | 67 virtual void OnAccessibilityModeChanged() = 0; |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 virtual ~AccessibilityObserver() {} | 70 virtual ~AccessibilityObserver() {} |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 class InputDeviceEventObserver { |
| 74 public: |
| 75 virtual void OnKeyboardDeviceConfigurationChanged() = 0; |
| 76 |
| 77 protected: |
| 78 virtual ~InputDeviceEventObserver() {} |
| 79 }; |
| 80 |
| 73 virtual ~WMHelper(); | 81 virtual ~WMHelper(); |
| 74 | 82 |
| 75 static void SetInstance(WMHelper* helper); | 83 static void SetInstance(WMHelper* helper); |
| 76 static WMHelper* GetInstance(); | 84 static WMHelper* GetInstance(); |
| 77 | 85 |
| 78 void AddActivationObserver(ActivationObserver* observer); | 86 void AddActivationObserver(ActivationObserver* observer); |
| 79 void RemoveActivationObserver(ActivationObserver* observer); | 87 void RemoveActivationObserver(ActivationObserver* observer); |
| 80 void AddFocusObserver(FocusObserver* observer); | 88 void AddFocusObserver(FocusObserver* observer); |
| 81 void RemoveFocusObserver(FocusObserver* observer); | 89 void RemoveFocusObserver(FocusObserver* observer); |
| 82 void AddCursorObserver(CursorObserver* observer); | 90 void AddCursorObserver(CursorObserver* observer); |
| 83 void RemoveCursorObserver(CursorObserver* observer); | 91 void RemoveCursorObserver(CursorObserver* observer); |
| 84 void AddMaximizeModeObserver(MaximizeModeObserver* observer); | 92 void AddMaximizeModeObserver(MaximizeModeObserver* observer); |
| 85 void RemoveMaximizeModeObserver(MaximizeModeObserver* observer); | 93 void RemoveMaximizeModeObserver(MaximizeModeObserver* observer); |
| 86 void AddAccessibilityObserver(AccessibilityObserver* observer); | 94 void AddAccessibilityObserver(AccessibilityObserver* observer); |
| 87 void RemoveAccessibilityObserver(AccessibilityObserver* observer); | 95 void RemoveAccessibilityObserver(AccessibilityObserver* observer); |
| 96 void AddInputDeviceEventObserver(InputDeviceEventObserver* observer); |
| 97 void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer); |
| 88 | 98 |
| 89 virtual const display::ManagedDisplayInfo GetDisplayInfo( | 99 virtual const display::ManagedDisplayInfo GetDisplayInfo( |
| 90 int64_t display_id) const = 0; | 100 int64_t display_id) const = 0; |
| 91 virtual aura::Window* GetContainer(int container_id) = 0; | 101 virtual aura::Window* GetContainer(int container_id) = 0; |
| 92 virtual aura::Window* GetActiveWindow() const = 0; | 102 virtual aura::Window* GetActiveWindow() const = 0; |
| 93 virtual aura::Window* GetFocusedWindow() const = 0; | 103 virtual aura::Window* GetFocusedWindow() const = 0; |
| 94 virtual ui::CursorSetType GetCursorSet() const = 0; | 104 virtual ui::CursorSetType GetCursorSet() const = 0; |
| 95 virtual void AddPreTargetHandler(ui::EventHandler* handler) = 0; | 105 virtual void AddPreTargetHandler(ui::EventHandler* handler) = 0; |
| 96 virtual void PrependPreTargetHandler(ui::EventHandler* handler) = 0; | 106 virtual void PrependPreTargetHandler(ui::EventHandler* handler) = 0; |
| 97 virtual void RemovePreTargetHandler(ui::EventHandler* handler) = 0; | 107 virtual void RemovePreTargetHandler(ui::EventHandler* handler) = 0; |
| 98 virtual void AddPostTargetHandler(ui::EventHandler* handler) = 0; | 108 virtual void AddPostTargetHandler(ui::EventHandler* handler) = 0; |
| 99 virtual void RemovePostTargetHandler(ui::EventHandler* handler) = 0; | 109 virtual void RemovePostTargetHandler(ui::EventHandler* handler) = 0; |
| 100 virtual bool IsMaximizeModeWindowManagerEnabled() const = 0; | 110 virtual bool IsMaximizeModeWindowManagerEnabled() const = 0; |
| 101 virtual bool IsSpokenFeedbackEnabled() const = 0; | 111 virtual bool IsSpokenFeedbackEnabled() const = 0; |
| 102 virtual void PlayEarcon(int sound_key) const = 0; | 112 virtual void PlayEarcon(int sound_key) const = 0; |
| 103 | 113 |
| 104 protected: | 114 protected: |
| 105 WMHelper(); | 115 WMHelper(); |
| 106 | 116 |
| 107 void NotifyWindowActivated(aura::Window* gained_active, | 117 void NotifyWindowActivated(aura::Window* gained_active, |
| 108 aura::Window* lost_active); | 118 aura::Window* lost_active); |
| 109 void NotifyWindowFocused(aura::Window* gained_focus, | 119 void NotifyWindowFocused(aura::Window* gained_focus, |
| 110 aura::Window* lost_focus); | 120 aura::Window* lost_focus); |
| 111 void NotifyCursorVisibilityChanged(bool is_visible); | 121 void NotifyCursorVisibilityChanged(bool is_visible); |
| 112 void NotifyCursorSetChanged(ui::CursorSetType cursor_set); | 122 void NotifyCursorSetChanged(ui::CursorSetType cursor_set); |
| 113 void NotifyMaximizeModeStarted(); | 123 void NotifyMaximizeModeStarted(); |
| 114 void NotifyMaximizeModeEnded(); | 124 void NotifyMaximizeModeEnded(); |
| 115 void NotifyAccessibilityModeChanged(); | 125 void NotifyAccessibilityModeChanged(); |
| 126 void NotifyKeyboardDeviceConfigurationChanged(); |
| 116 | 127 |
| 117 private: | 128 private: |
| 118 base::ObserverList<ActivationObserver> activation_observers_; | 129 base::ObserverList<ActivationObserver> activation_observers_; |
| 119 base::ObserverList<FocusObserver> focus_observers_; | 130 base::ObserverList<FocusObserver> focus_observers_; |
| 120 base::ObserverList<CursorObserver> cursor_observers_; | 131 base::ObserverList<CursorObserver> cursor_observers_; |
| 121 base::ObserverList<MaximizeModeObserver> maximize_mode_observers_; | 132 base::ObserverList<MaximizeModeObserver> maximize_mode_observers_; |
| 122 base::ObserverList<AccessibilityObserver> accessibility_observers_; | 133 base::ObserverList<AccessibilityObserver> accessibility_observers_; |
| 134 base::ObserverList<InputDeviceEventObserver> input_device_event_observers_; |
| 123 | 135 |
| 124 DISALLOW_COPY_AND_ASSIGN(WMHelper); | 136 DISALLOW_COPY_AND_ASSIGN(WMHelper); |
| 125 }; | 137 }; |
| 126 | 138 |
| 127 } // namespace exo | 139 } // namespace exo |
| 128 | 140 |
| 129 #endif // COMPONENTS_EXO_WM_HELPER_H_ | 141 #endif // COMPONENTS_EXO_WM_HELPER_H_ |
| OLD | NEW |