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

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

Issue 1605773004: mus: Implement Window Server Capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Original Review Comments Created 4 years, 11 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const mojom::ViewportMetrics& GetViewportMetrics() const; 81 const mojom::ViewportMetrics& GetViewportMetrics() const;
82 82
83 ConnectionManager* connection_manager() { return connection_manager_; } 83 ConnectionManager* connection_manager() { return connection_manager_; }
84 84
85 mojom::WindowManager* window_manager() { return window_manager_.get(); } 85 mojom::WindowManager* window_manager() { return window_manager_.get(); }
86 86
87 // Returns the root ServerWindow of this viewport. 87 // Returns the root ServerWindow of this viewport.
88 ServerWindow* root_window() { return root_.get(); } 88 ServerWindow* root_window() { return root_.get(); }
89 const ServerWindow* root_window() const { return root_.get(); } 89 const ServerWindow* root_window() const { return root_.get(); }
90 90
91 void SetCapture(ServerWindow* window);
92 void ReleaseCapture(ServerWindow* window);
93
91 void SetFocusedWindow(ServerWindow* window); 94 void SetFocusedWindow(ServerWindow* window);
92 ServerWindow* GetFocusedWindow(); 95 ServerWindow* GetFocusedWindow();
93 void DestroyFocusController(); 96 void DestroyFocusController();
94 97
95 void UpdateTextInputState(ServerWindow* window, 98 void UpdateTextInputState(ServerWindow* window,
96 const ui::TextInputState& state); 99 const ui::TextInputState& state);
97 void SetImeVisibility(ServerWindow* window, bool visible); 100 void SetImeVisibility(ServerWindow* window, bool visible);
98 101
102 // Returns the window that has captured input.
103 ServerWindow* GetCaptureWindow() {
104 return event_dispatcher_.capture_window();
105 }
106 const ServerWindow* GetCaptureWindow() const {
107 return event_dispatcher_.capture_window();
108 }
109
99 // Called just before |tree| is destroyed after its connection encounters an 110 // Called just before |tree| is destroyed after its connection encounters an
100 // error. 111 // error.
101 void OnWindowTreeConnectionError(WindowTreeImpl* tree); 112 void OnWindowTreeConnectionError(WindowTreeImpl* tree);
102 113
103 // Called when a client updates a cursor. This will update the cursor on the 114 // Called when a client updates a cursor. This will update the cursor on the
104 // native display if the cursor is currently under |window|. 115 // native display if the cursor is currently under |window|.
105 void OnCursorUpdated(ServerWindow* window); 116 void OnCursorUpdated(ServerWindow* window);
106 117
107 // Called when the window tree when stacking and bounds of a window 118 // Called when the window tree when stacking and bounds of a window
108 // change. This may update the cursor if the ServerWindow under the last 119 // change. This may update the cursor if the ServerWindow under the last
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // Dispatches the event to the appropriate client and starts the ack timer. 176 // Dispatches the event to the appropriate client and starts the ack timer.
166 void DispatchInputEventToWindowImpl(ServerWindow* target, 177 void DispatchInputEventToWindowImpl(ServerWindow* target,
167 bool in_nonclient_area, 178 bool in_nonclient_area,
168 mojom::EventPtr event); 179 mojom::EventPtr event);
169 180
170 void UpdateNativeCursor(int32_t cursor_id); 181 void UpdateNativeCursor(int32_t cursor_id);
171 182
172 // DisplayManagerDelegate: 183 // DisplayManagerDelegate:
173 ServerWindow* GetRootWindow() override; 184 ServerWindow* GetRootWindow() override;
174 void OnEvent(const ui::Event& event) override; 185 void OnEvent(const ui::Event& event) override;
186 void OnLostCapture() override;
175 void OnDisplayClosed() override; 187 void OnDisplayClosed() override;
176 void OnViewportMetricsChanged( 188 void OnViewportMetricsChanged(
177 const mojom::ViewportMetrics& old_metrics, 189 const mojom::ViewportMetrics& old_metrics,
178 const mojom::ViewportMetrics& new_metrics) override; 190 const mojom::ViewportMetrics& new_metrics) override;
179 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; 191 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override;
180 void OnCompositorFrameDrawn() override; 192 void OnCompositorFrameDrawn() override;
181 193
182 // FocusControllerDelegate: 194 // FocusControllerDelegate:
183 bool CanHaveActiveChildren(ServerWindow* window) const override; 195 bool CanHaveActiveChildren(ServerWindow* window) const override;
184 196
185 // FocusControllerObserver: 197 // FocusControllerObserver:
186 void OnActivationChanged(ServerWindow* old_active_window, 198 void OnActivationChanged(ServerWindow* old_active_window,
187 ServerWindow* new_active_window) override; 199 ServerWindow* new_active_window) override;
188 void OnFocusChanged(FocusControllerChangeSource change_source, 200 void OnFocusChanged(FocusControllerChangeSource change_source,
189 ServerWindow* old_focused_window, 201 ServerWindow* old_focused_window,
190 ServerWindow* new_focused_window) override; 202 ServerWindow* new_focused_window) override;
191 203
192 // EventDispatcherDelegate: 204 // EventDispatcherDelegate:
193 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; 205 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override;
194 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; 206 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
195 ServerWindow* GetFocusedWindowForEventDispatcher() override; 207 ServerWindow* GetFocusedWindowForEventDispatcher() override;
208 void OnLostCapture(ServerWindow* window) override;
196 void DispatchInputEventToWindow(ServerWindow* target, 209 void DispatchInputEventToWindow(ServerWindow* target,
197 bool in_nonclient_area, 210 bool in_nonclient_area,
198 mojom::EventPtr event) override; 211 mojom::EventPtr event) override;
199 212
200 // ServerWindowObserver: 213 // ServerWindowObserver:
201 void OnWindowDestroyed(ServerWindow* window) override; 214 void OnWindowDestroyed(ServerWindow* window) override;
202 215
203 WindowTreeHostDelegate* delegate_; 216 WindowTreeHostDelegate* delegate_;
204 ConnectionManager* const connection_manager_; 217 ConnectionManager* const connection_manager_;
205 mojom::WindowTreeHostClientPtr client_; 218 mojom::WindowTreeHostClientPtr client_;
(...skipping 16 matching lines...) Expand all
222 std::queue<scoped_ptr<QueuedEvent>> event_queue_; 235 std::queue<scoped_ptr<QueuedEvent>> event_queue_;
223 base::OneShotTimer event_ack_timer_; 236 base::OneShotTimer event_ack_timer_;
224 237
225 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); 238 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl);
226 }; 239 };
227 240
228 } // namespace ws 241 } // namespace ws
229 } // namespace mus 242 } // namespace mus
230 243
231 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 244 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698