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