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

Side by Side Diff: components/mus/ws/window_tree_host_impl.h

Issue 1677513002: mus Window Server: implement event capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « components/mus/ws/window_tree_apptest.cc ('k') | components/mus/ws/window_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 mojom::Rotation GetRotation() const; 88 mojom::Rotation GetRotation() const;
89 89
90 ConnectionManager* connection_manager() { return connection_manager_; } 90 ConnectionManager* connection_manager() { return connection_manager_; }
91 91
92 EventDispatcher* event_dispatcher() { return &event_dispatcher_; } 92 EventDispatcher* event_dispatcher() { return &event_dispatcher_; }
93 93
94 // Returns the root ServerWindow of this viewport. 94 // Returns the root ServerWindow of this viewport.
95 ServerWindow* root_window() { return root_.get(); } 95 ServerWindow* root_window() { return root_.get(); }
96 const ServerWindow* root_window() const { return root_.get(); } 96 const ServerWindow* root_window() const { return root_.get(); }
97 97
98 void SetCapture(ServerWindow* window, bool in_nonclient_area);
99
98 void SetFocusedWindow(ServerWindow* window); 100 void SetFocusedWindow(ServerWindow* window);
99 ServerWindow* GetFocusedWindow(); 101 ServerWindow* GetFocusedWindow();
100 void DestroyFocusController(); 102 void DestroyFocusController();
101 FocusController* focus_controller() { return focus_controller_.get(); } 103 FocusController* focus_controller() { return focus_controller_.get(); }
102 104
103 void AddActivationParent(ServerWindow* window); 105 void AddActivationParent(ServerWindow* window);
104 void RemoveActivationParent(ServerWindow* window); 106 void RemoveActivationParent(ServerWindow* window);
105 107
106 void UpdateTextInputState(ServerWindow* window, 108 void UpdateTextInputState(ServerWindow* window,
107 const ui::TextInputState& state); 109 const ui::TextInputState& state);
108 void SetImeVisibility(ServerWindow* window, bool visible); 110 void SetImeVisibility(ServerWindow* window, bool visible);
109 111
112 // Returns the window that has captured input.
113 ServerWindow* GetCaptureWindow() {
114 return event_dispatcher_.capture_window();
115 }
116 const ServerWindow* GetCaptureWindow() const {
117 return event_dispatcher_.capture_window();
118 }
119
110 // Called just before |tree| is destroyed after its connection encounters an 120 // Called just before |tree| is destroyed after its connection encounters an
111 // error. 121 // error.
112 void OnWindowTreeConnectionError(WindowTreeImpl* tree); 122 void OnWindowTreeConnectionError(WindowTreeImpl* tree);
113 123
114 // Called when a client updates a cursor. This will update the cursor on the 124 // Called when a client updates a cursor. This will update the cursor on the
115 // native display if the cursor is currently under |window|. 125 // native display if the cursor is currently under |window|.
116 void OnCursorUpdated(ServerWindow* window); 126 void OnCursorUpdated(ServerWindow* window);
117 127
118 // Called when the window tree when stacking and bounds of a window 128 // Called when the window tree when stacking and bounds of a window
119 // change. This may update the cursor if the ServerWindow under the last 129 // change. This may update the cursor if the ServerWindow under the last
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // Dispatches the event to the appropriate client and starts the ack timer. 170 // Dispatches the event to the appropriate client and starts the ack timer.
161 void DispatchInputEventToWindowImpl(ServerWindow* target, 171 void DispatchInputEventToWindowImpl(ServerWindow* target,
162 bool in_nonclient_area, 172 bool in_nonclient_area,
163 mojom::EventPtr event); 173 mojom::EventPtr event);
164 174
165 void UpdateNativeCursor(int32_t cursor_id); 175 void UpdateNativeCursor(int32_t cursor_id);
166 176
167 // DisplayManagerDelegate: 177 // DisplayManagerDelegate:
168 ServerWindow* GetRootWindow() override; 178 ServerWindow* GetRootWindow() override;
169 void OnEvent(const ui::Event& event) override; 179 void OnEvent(const ui::Event& event) override;
180 void OnNativeCaptureLost() override;
170 void OnDisplayClosed() override; 181 void OnDisplayClosed() override;
171 void OnViewportMetricsChanged( 182 void OnViewportMetricsChanged(
172 const mojom::ViewportMetrics& old_metrics, 183 const mojom::ViewportMetrics& old_metrics,
173 const mojom::ViewportMetrics& new_metrics) override; 184 const mojom::ViewportMetrics& new_metrics) override;
174 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; 185 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override;
175 void OnCompositorFrameDrawn() override; 186 void OnCompositorFrameDrawn() override;
176 187
177 // FocusControllerDelegate: 188 // FocusControllerDelegate:
178 bool CanHaveActiveChildren(ServerWindow* window) const override; 189 bool CanHaveActiveChildren(ServerWindow* window) const override;
179 190
180 // FocusControllerObserver: 191 // FocusControllerObserver:
181 void OnActivationChanged(ServerWindow* old_active_window, 192 void OnActivationChanged(ServerWindow* old_active_window,
182 ServerWindow* new_active_window) override; 193 ServerWindow* new_active_window) override;
183 void OnFocusChanged(FocusControllerChangeSource change_source, 194 void OnFocusChanged(FocusControllerChangeSource change_source,
184 ServerWindow* old_focused_window, 195 ServerWindow* old_focused_window,
185 ServerWindow* new_focused_window) override; 196 ServerWindow* new_focused_window) override;
186 197
187 // EventDispatcherDelegate: 198 // EventDispatcherDelegate:
188 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; 199 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override;
189 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; 200 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
190 ServerWindow* GetFocusedWindowForEventDispatcher() override; 201 ServerWindow* GetFocusedWindowForEventDispatcher() override;
202 void SetNativeCapture() override;
203 void ReleaseNativeCapture() override;
204 void OnServerWindowCaptureLost(ServerWindow* window) override;
191 void DispatchInputEventToWindow(ServerWindow* target, 205 void DispatchInputEventToWindow(ServerWindow* target,
192 bool in_nonclient_area, 206 bool in_nonclient_area,
193 mojom::EventPtr event) override; 207 mojom::EventPtr event) override;
194 208
195 // ServerWindowObserver: 209 // ServerWindowObserver:
196 void OnWindowDestroyed(ServerWindow* window) override; 210 void OnWindowDestroyed(ServerWindow* window) override;
197 211
198 const uint32_t id_; 212 const uint32_t id_;
199 WindowTreeHostDelegate* delegate_; 213 WindowTreeHostDelegate* delegate_;
200 ConnectionManager* const connection_manager_; 214 ConnectionManager* const connection_manager_;
(...skipping 17 matching lines...) Expand all
218 232
219 mojom::FrameDecorationValuesPtr frame_decoration_values_; 233 mojom::FrameDecorationValuesPtr frame_decoration_values_;
220 234
221 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); 235 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl);
222 }; 236 };
223 237
224 } // namespace ws 238 } // namespace ws
225 } // namespace mus 239 } // namespace mus
226 240
227 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 241 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree_apptest.cc ('k') | components/mus/ws/window_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698