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

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
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 const mojom::ViewportMetrics& GetViewportMetrics() const; 88 const mojom::ViewportMetrics& GetViewportMetrics() const;
89 89
90 mojom::Rotation GetRotation() const; 90 mojom::Rotation GetRotation() const;
91 91
92 ConnectionManager* connection_manager() { return connection_manager_; } 92 ConnectionManager* connection_manager() { return connection_manager_; }
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 void ReleaseCapture(ServerWindow* window);
100
98 void SetFocusedWindow(ServerWindow* window); 101 void SetFocusedWindow(ServerWindow* window);
99 ServerWindow* GetFocusedWindow(); 102 ServerWindow* GetFocusedWindow();
100 void DestroyFocusController(); 103 void DestroyFocusController();
101 104
102 void UpdateTextInputState(ServerWindow* window, 105 void UpdateTextInputState(ServerWindow* window,
103 const ui::TextInputState& state); 106 const ui::TextInputState& state);
104 void SetImeVisibility(ServerWindow* window, bool visible); 107 void SetImeVisibility(ServerWindow* window, bool visible);
105 108
109 // Returns the window that has captured input.
110 ServerWindow* GetCaptureWindow() {
111 return event_dispatcher_.capture_window();
112 }
113 const ServerWindow* GetCaptureWindow() const {
114 return event_dispatcher_.capture_window();
115 }
116
106 // Called just before |tree| is destroyed after its connection encounters an 117 // Called just before |tree| is destroyed after its connection encounters an
107 // error. 118 // error.
108 void OnWindowTreeConnectionError(WindowTreeImpl* tree); 119 void OnWindowTreeConnectionError(WindowTreeImpl* tree);
109 120
110 // Called when a client updates a cursor. This will update the cursor on the 121 // Called when a client updates a cursor. This will update the cursor on the
111 // native display if the cursor is currently under |window|. 122 // native display if the cursor is currently under |window|.
112 void OnCursorUpdated(ServerWindow* window); 123 void OnCursorUpdated(ServerWindow* window);
113 124
114 // Called when the window tree when stacking and bounds of a window 125 // Called when the window tree when stacking and bounds of a window
115 // change. This may update the cursor if the ServerWindow under the last 126 // change. This may update the cursor if the ServerWindow under the last
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Dispatches the event to the appropriate client and starts the ack timer. 185 // Dispatches the event to the appropriate client and starts the ack timer.
175 void DispatchInputEventToWindowImpl(ServerWindow* target, 186 void DispatchInputEventToWindowImpl(ServerWindow* target,
176 bool in_nonclient_area, 187 bool in_nonclient_area,
177 mojom::EventPtr event); 188 mojom::EventPtr event);
178 189
179 void UpdateNativeCursor(int32_t cursor_id); 190 void UpdateNativeCursor(int32_t cursor_id);
180 191
181 // DisplayManagerDelegate: 192 // DisplayManagerDelegate:
182 ServerWindow* GetRootWindow() override; 193 ServerWindow* GetRootWindow() override;
183 void OnEvent(const ui::Event& event) override; 194 void OnEvent(const ui::Event& event) override;
195 void OnLostCapture() override;
184 void OnDisplayClosed() override; 196 void OnDisplayClosed() override;
185 void OnViewportMetricsChanged( 197 void OnViewportMetricsChanged(
186 const mojom::ViewportMetrics& old_metrics, 198 const mojom::ViewportMetrics& old_metrics,
187 const mojom::ViewportMetrics& new_metrics) override; 199 const mojom::ViewportMetrics& new_metrics) override;
188 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; 200 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override;
189 void OnCompositorFrameDrawn() override; 201 void OnCompositorFrameDrawn() override;
190 202
191 // FocusControllerDelegate: 203 // FocusControllerDelegate:
192 bool CanHaveActiveChildren(ServerWindow* window) const override; 204 bool CanHaveActiveChildren(ServerWindow* window) const override;
193 205
194 // FocusControllerObserver: 206 // FocusControllerObserver:
195 void OnActivationChanged(ServerWindow* old_active_window, 207 void OnActivationChanged(ServerWindow* old_active_window,
196 ServerWindow* new_active_window) override; 208 ServerWindow* new_active_window) override;
197 void OnFocusChanged(FocusControllerChangeSource change_source, 209 void OnFocusChanged(FocusControllerChangeSource change_source,
198 ServerWindow* old_focused_window, 210 ServerWindow* old_focused_window,
199 ServerWindow* new_focused_window) override; 211 ServerWindow* new_focused_window) override;
200 212
201 // EventDispatcherDelegate: 213 // EventDispatcherDelegate:
202 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; 214 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override;
203 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; 215 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
204 ServerWindow* GetFocusedWindowForEventDispatcher() override; 216 ServerWindow* GetFocusedWindowForEventDispatcher() override;
217 void OnLostCapture(ServerWindow* window) override;
205 void DispatchInputEventToWindow(ServerWindow* target, 218 void DispatchInputEventToWindow(ServerWindow* target,
206 bool in_nonclient_area, 219 bool in_nonclient_area,
207 mojom::EventPtr event) override; 220 mojom::EventPtr event) override;
208 221
209 // ServerWindowObserver: 222 // ServerWindowObserver:
210 void OnWindowDestroyed(ServerWindow* window) override; 223 void OnWindowDestroyed(ServerWindow* window) override;
211 224
212 const uint32_t id_; 225 const uint32_t id_;
213 WindowTreeHostDelegate* delegate_; 226 WindowTreeHostDelegate* delegate_;
214 ConnectionManager* const connection_manager_; 227 ConnectionManager* const connection_manager_;
(...skipping 18 matching lines...) Expand all
233 246
234 mojom::FrameDecorationValuesPtr frame_decoration_values_; 247 mojom::FrameDecorationValuesPtr frame_decoration_values_;
235 248
236 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); 249 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl);
237 }; 250 };
238 251
239 } // namespace ws 252 } // namespace ws
240 } // namespace mus 253 } // namespace mus
241 254
242 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 255 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698