| 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" |
| 11 #include "ui/gfx/native_widget_types.h" |
| 11 | 12 |
| 12 namespace aura { | 13 namespace aura { |
| 13 class Window; | 14 class Window; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace display { | 17 namespace display { |
| 18 class Display; |
| 17 class ManagedDisplayInfo; | 19 class ManagedDisplayInfo; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace ui { | 22 namespace ui { |
| 21 class EventHandler; | 23 class EventHandler; |
| 22 } | 24 } |
| 23 | 25 |
| 24 namespace exo { | 26 namespace exo { |
| 25 | 27 |
| 26 // A helper class for accessing WindowManager related features. | 28 // A helper class for accessing WindowManager related features. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 aura::Window* lost_focus) = 0; | 43 aura::Window* lost_focus) = 0; |
| 42 | 44 |
| 43 protected: | 45 protected: |
| 44 virtual ~FocusObserver() {} | 46 virtual ~FocusObserver() {} |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 class CursorObserver { | 49 class CursorObserver { |
| 48 public: | 50 public: |
| 49 virtual void OnCursorVisibilityChanged(bool is_visible) {} | 51 virtual void OnCursorVisibilityChanged(bool is_visible) {} |
| 50 virtual void OnCursorSetChanged(ui::CursorSetType cursor_set) {} | 52 virtual void OnCursorSetChanged(ui::CursorSetType cursor_set) {} |
| 53 virtual void OnCursorDisplayChanging(const display::Display& display) {} |
| 51 | 54 |
| 52 protected: | 55 protected: |
| 53 virtual ~CursorObserver() {} | 56 virtual ~CursorObserver() {} |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 class MaximizeModeObserver { | 59 class MaximizeModeObserver { |
| 57 public: | 60 public: |
| 58 virtual void OnMaximizeModeStarted() = 0; | 61 virtual void OnMaximizeModeStarted() = 0; |
| 59 virtual void OnMaximizeModeEnding() = 0; | 62 virtual void OnMaximizeModeEnding() = 0; |
| 60 virtual void OnMaximizeModeEnded() = 0; | 63 virtual void OnMaximizeModeEnded() = 0; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 void AddAccessibilityObserver(AccessibilityObserver* observer); | 106 void AddAccessibilityObserver(AccessibilityObserver* observer); |
| 104 void RemoveAccessibilityObserver(AccessibilityObserver* observer); | 107 void RemoveAccessibilityObserver(AccessibilityObserver* observer); |
| 105 void AddInputDeviceEventObserver(InputDeviceEventObserver* observer); | 108 void AddInputDeviceEventObserver(InputDeviceEventObserver* observer); |
| 106 void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer); | 109 void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer); |
| 107 void AddDisplayConfigurationObserver(DisplayConfigurationObserver* observer); | 110 void AddDisplayConfigurationObserver(DisplayConfigurationObserver* observer); |
| 108 void RemoveDisplayConfigurationObserver( | 111 void RemoveDisplayConfigurationObserver( |
| 109 DisplayConfigurationObserver* observer); | 112 DisplayConfigurationObserver* observer); |
| 110 | 113 |
| 111 virtual const display::ManagedDisplayInfo GetDisplayInfo( | 114 virtual const display::ManagedDisplayInfo GetDisplayInfo( |
| 112 int64_t display_id) const = 0; | 115 int64_t display_id) const = 0; |
| 113 virtual aura::Window* GetContainer(int container_id) = 0; | 116 virtual aura::Window* GetContainer(int64_t display_id, int container_id) = 0; |
| 114 virtual aura::Window* GetActiveWindow() const = 0; | 117 virtual aura::Window* GetActiveWindow() const = 0; |
| 115 virtual aura::Window* GetFocusedWindow() const = 0; | 118 virtual aura::Window* GetFocusedWindow() const = 0; |
| 116 virtual ui::CursorSetType GetCursorSet() const = 0; | 119 virtual ui::CursorSetType GetCursorSet() const = 0; |
| 117 virtual void AddPreTargetHandler(ui::EventHandler* handler) = 0; | 120 virtual void AddPreTargetHandler(ui::EventHandler* handler) = 0; |
| 118 virtual void PrependPreTargetHandler(ui::EventHandler* handler) = 0; | 121 virtual void PrependPreTargetHandler(ui::EventHandler* handler) = 0; |
| 119 virtual void RemovePreTargetHandler(ui::EventHandler* handler) = 0; | 122 virtual void RemovePreTargetHandler(ui::EventHandler* handler) = 0; |
| 120 virtual void AddPostTargetHandler(ui::EventHandler* handler) = 0; | 123 virtual void AddPostTargetHandler(ui::EventHandler* handler) = 0; |
| 121 virtual void RemovePostTargetHandler(ui::EventHandler* handler) = 0; | 124 virtual void RemovePostTargetHandler(ui::EventHandler* handler) = 0; |
| 122 virtual bool IsMaximizeModeWindowManagerEnabled() const = 0; | 125 virtual bool IsMaximizeModeWindowManagerEnabled() const = 0; |
| 123 virtual bool IsSpokenFeedbackEnabled() const = 0; | 126 virtual bool IsSpokenFeedbackEnabled() const = 0; |
| 124 virtual void PlayEarcon(int sound_key) const = 0; | 127 virtual void PlayEarcon(int sound_key) const = 0; |
| 128 virtual void SetCursor(gfx::NativeCursor cursor) = 0; |
| 125 | 129 |
| 126 protected: | 130 protected: |
| 127 WMHelper(); | 131 WMHelper(); |
| 128 | 132 |
| 129 void NotifyWindowActivated(aura::Window* gained_active, | 133 void NotifyWindowActivated(aura::Window* gained_active, |
| 130 aura::Window* lost_active); | 134 aura::Window* lost_active); |
| 131 void NotifyWindowFocused(aura::Window* gained_focus, | 135 void NotifyWindowFocused(aura::Window* gained_focus, |
| 132 aura::Window* lost_focus); | 136 aura::Window* lost_focus); |
| 133 void NotifyCursorVisibilityChanged(bool is_visible); | 137 void NotifyCursorVisibilityChanged(bool is_visible); |
| 134 void NotifyCursorSetChanged(ui::CursorSetType cursor_set); | 138 void NotifyCursorSetChanged(ui::CursorSetType cursor_set); |
| 139 void NotifyCursorDisplayChanging(const display::Display& display); |
| 135 void NotifyMaximizeModeStarted(); | 140 void NotifyMaximizeModeStarted(); |
| 136 void NotifyMaximizeModeEnding(); | 141 void NotifyMaximizeModeEnding(); |
| 137 void NotifyMaximizeModeEnded(); | 142 void NotifyMaximizeModeEnded(); |
| 138 void NotifyAccessibilityModeChanged(); | 143 void NotifyAccessibilityModeChanged(); |
| 139 void NotifyKeyboardDeviceConfigurationChanged(); | 144 void NotifyKeyboardDeviceConfigurationChanged(); |
| 140 void NotifyDisplayConfigurationChanged(); | 145 void NotifyDisplayConfigurationChanged(); |
| 141 | 146 |
| 142 private: | 147 private: |
| 143 base::ObserverList<ActivationObserver> activation_observers_; | 148 base::ObserverList<ActivationObserver> activation_observers_; |
| 144 base::ObserverList<FocusObserver> focus_observers_; | 149 base::ObserverList<FocusObserver> focus_observers_; |
| 145 base::ObserverList<CursorObserver> cursor_observers_; | 150 base::ObserverList<CursorObserver> cursor_observers_; |
| 146 base::ObserverList<MaximizeModeObserver> maximize_mode_observers_; | 151 base::ObserverList<MaximizeModeObserver> maximize_mode_observers_; |
| 147 base::ObserverList<AccessibilityObserver> accessibility_observers_; | 152 base::ObserverList<AccessibilityObserver> accessibility_observers_; |
| 148 base::ObserverList<InputDeviceEventObserver> input_device_event_observers_; | 153 base::ObserverList<InputDeviceEventObserver> input_device_event_observers_; |
| 149 base::ObserverList<DisplayConfigurationObserver> display_config_observers_; | 154 base::ObserverList<DisplayConfigurationObserver> display_config_observers_; |
| 150 | 155 |
| 151 DISALLOW_COPY_AND_ASSIGN(WMHelper); | 156 DISALLOW_COPY_AND_ASSIGN(WMHelper); |
| 152 }; | 157 }; |
| 153 | 158 |
| 154 } // namespace exo | 159 } // namespace exo |
| 155 | 160 |
| 156 #endif // COMPONENTS_EXO_WM_HELPER_H_ | 161 #endif // COMPONENTS_EXO_WM_HELPER_H_ |
| OLD | NEW |