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