Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: components/exo/wm_helper.h

Issue 2780623002: exo: Fix multi-display hardware cursor (Closed)
Patch Set: Address comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 30 matching lines...) Expand all
91 void AddCursorObserver(CursorObserver* observer); 93 void AddCursorObserver(CursorObserver* observer);
92 void RemoveCursorObserver(CursorObserver* observer); 94 void RemoveCursorObserver(CursorObserver* observer);
93 void AddMaximizeModeObserver(MaximizeModeObserver* observer); 95 void AddMaximizeModeObserver(MaximizeModeObserver* observer);
94 void RemoveMaximizeModeObserver(MaximizeModeObserver* observer); 96 void RemoveMaximizeModeObserver(MaximizeModeObserver* observer);
95 void AddInputDeviceEventObserver(InputDeviceEventObserver* observer); 97 void AddInputDeviceEventObserver(InputDeviceEventObserver* observer);
96 void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer); 98 void RemoveInputDeviceEventObserver(InputDeviceEventObserver* observer);
97 void AddDisplayConfigurationObserver(DisplayConfigurationObserver* observer); 99 void AddDisplayConfigurationObserver(DisplayConfigurationObserver* observer);
98 void RemoveDisplayConfigurationObserver( 100 void RemoveDisplayConfigurationObserver(
99 DisplayConfigurationObserver* observer); 101 DisplayConfigurationObserver* observer);
100 102
101 virtual const display::ManagedDisplayInfo GetDisplayInfo( 103 virtual const display::ManagedDisplayInfo& GetDisplayInfo(
102 int64_t display_id) const = 0; 104 int64_t display_id) const = 0;
103 virtual aura::Window* GetContainer(int container_id) = 0; 105 virtual aura::Window* GetContainer(int64_t display_id, int container_id) = 0;
reveman 2017/05/25 10:52:55 I don't think we need this anymore.
Dominik Laskowski 2017/05/31 02:06:27 Still needed to parent the cursor surface to the p
reveman 2017/05/31 03:33:10 Isn't this always returning the container for the
Dominik Laskowski 2017/05/31 20:35:54 Renamed to GetPrimaryDisplayContainer.
104 virtual aura::Window* GetActiveWindow() const = 0; 106 virtual aura::Window* GetActiveWindow() const = 0;
105 virtual aura::Window* GetFocusedWindow() const = 0; 107 virtual aura::Window* GetFocusedWindow() const = 0;
106 virtual ui::CursorSetType GetCursorSet() const = 0; 108 virtual ui::CursorSetType GetCursorSet() const = 0;
107 virtual void AddPreTargetHandler(ui::EventHandler* handler) = 0; 109 virtual void AddPreTargetHandler(ui::EventHandler* handler) = 0;
108 virtual void PrependPreTargetHandler(ui::EventHandler* handler) = 0; 110 virtual void PrependPreTargetHandler(ui::EventHandler* handler) = 0;
109 virtual void RemovePreTargetHandler(ui::EventHandler* handler) = 0; 111 virtual void RemovePreTargetHandler(ui::EventHandler* handler) = 0;
110 virtual void AddPostTargetHandler(ui::EventHandler* handler) = 0; 112 virtual void AddPostTargetHandler(ui::EventHandler* handler) = 0;
111 virtual void RemovePostTargetHandler(ui::EventHandler* handler) = 0; 113 virtual void RemovePostTargetHandler(ui::EventHandler* handler) = 0;
112 virtual bool IsMaximizeModeWindowManagerEnabled() const = 0; 114 virtual bool IsMaximizeModeWindowManagerEnabled() const = 0;
113 115
114 protected: 116 protected:
115 WMHelper(); 117 WMHelper();
116 118
117 void NotifyWindowActivated(aura::Window* gained_active, 119 void NotifyWindowActivated(aura::Window* gained_active,
118 aura::Window* lost_active); 120 aura::Window* lost_active);
119 void NotifyWindowFocused(aura::Window* gained_focus, 121 void NotifyWindowFocused(aura::Window* gained_focus,
120 aura::Window* lost_focus); 122 aura::Window* lost_focus);
121 void NotifyCursorVisibilityChanged(bool is_visible); 123 void NotifyCursorVisibilityChanged(bool is_visible);
122 void NotifyCursorSetChanged(ui::CursorSetType cursor_set); 124 void NotifyCursorSetChanged(ui::CursorSetType cursor_set);
125 void NotifyCursorDisplayChanging(const display::Display& display);
123 void NotifyMaximizeModeStarted(); 126 void NotifyMaximizeModeStarted();
124 void NotifyMaximizeModeEnding(); 127 void NotifyMaximizeModeEnding();
125 void NotifyMaximizeModeEnded(); 128 void NotifyMaximizeModeEnded();
126 void NotifyKeyboardDeviceConfigurationChanged(); 129 void NotifyKeyboardDeviceConfigurationChanged();
127 void NotifyDisplayConfigurationChanged(); 130 void NotifyDisplayConfigurationChanged();
128 131
129 private: 132 private:
130 base::ObserverList<ActivationObserver> activation_observers_; 133 base::ObserverList<ActivationObserver> activation_observers_;
131 base::ObserverList<FocusObserver> focus_observers_; 134 base::ObserverList<FocusObserver> focus_observers_;
132 base::ObserverList<CursorObserver> cursor_observers_; 135 base::ObserverList<CursorObserver> cursor_observers_;
133 base::ObserverList<MaximizeModeObserver> maximize_mode_observers_; 136 base::ObserverList<MaximizeModeObserver> maximize_mode_observers_;
134 base::ObserverList<InputDeviceEventObserver> input_device_event_observers_; 137 base::ObserverList<InputDeviceEventObserver> input_device_event_observers_;
135 base::ObserverList<DisplayConfigurationObserver> display_config_observers_; 138 base::ObserverList<DisplayConfigurationObserver> display_config_observers_;
136 139
137 DISALLOW_COPY_AND_ASSIGN(WMHelper); 140 DISALLOW_COPY_AND_ASSIGN(WMHelper);
138 }; 141 };
139 142
140 } // namespace exo 143 } // namespace exo
141 144
142 #endif // COMPONENTS_EXO_WM_HELPER_H_ 145 #endif // COMPONENTS_EXO_WM_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698