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

Side by Side Diff: services/ui/public/cpp/window_tree_client.h

Issue 2369793002: WIP: Propagate SurfaceID up window tree hierarchy
Patch Set: Fix input events: EventDispatcher ignores container windows Created 4 years, 2 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 | « services/ui/public/cpp/window_private.h ('k') | services/ui/public/cpp/window_tree_client.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_H_
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_H_ 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 uint32_t flags, 126 uint32_t flags,
127 const mojom::WindowTree::EmbedCallback& callback); 127 const mojom::WindowTree::EmbedCallback& callback);
128 128
129 void RequestClose(Window* window); 129 void RequestClose(Window* window);
130 130
131 void AttachSurface(Id window_id, 131 void AttachSurface(Id window_id,
132 mojom::SurfaceType type, 132 mojom::SurfaceType type,
133 mojo::InterfaceRequest<mojom::Surface> surface, 133 mojo::InterfaceRequest<mojom::Surface> surface,
134 mojom::SurfaceClientPtr client); 134 mojom::SurfaceClientPtr client);
135 135
136 void SatisfySurfaceSequence(Id window_id,
137 const cc::SurfaceSequence& sequence);
138
136 // Sets the input capture to |window| without notifying the server. 139 // Sets the input capture to |window| without notifying the server.
137 void LocalSetCapture(Window* window); 140 void LocalSetCapture(Window* window);
138 // Sets focus to |window| without notifying the server. 141 // Sets focus to |window| without notifying the server.
139 void LocalSetFocus(Window* window); 142 void LocalSetFocus(Window* window);
140 143
141 // Start/stop tracking windows. While tracked, they can be retrieved via 144 // Start/stop tracking windows. While tracked, they can be retrieved via
142 // WindowTreeClient::GetWindowById. 145 // WindowTreeClient::GetWindowById.
143 void AddWindow(Window* window); 146 void AddWindow(Window* window);
144 147
145 bool IsRoot(Window* window) const { return roots_.count(window) > 0; } 148 bool IsRoot(Window* window) const { return roots_.count(window) > 0; }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 ui::mojom::MoveLoopSource source, 198 ui::mojom::MoveLoopSource source,
196 const gfx::Point& cursor_location, 199 const gfx::Point& cursor_location,
197 const base::Callback<void(bool)>& callback); 200 const base::Callback<void(bool)>& callback);
198 201
199 // Cancels a in progress window move. (If no window is currently being moved, 202 // Cancels a in progress window move. (If no window is currently being moved,
200 // does nothing.) 203 // does nothing.)
201 void CancelWindowMove(Window* window); 204 void CancelWindowMove(Window* window);
202 205
203 // Creates and returns a new Window (which is owned by the window server). 206 // Creates and returns a new Window (which is owned by the window server).
204 // Windows are initially hidden, use SetVisible(true) to show. 207 // Windows are initially hidden, use SetVisible(true) to show.
208 Window* NewWindowContainer() {
209 return NewWindow(nullptr, true /* container */);
210 }
205 Window* NewWindow() { return NewWindow(nullptr); } 211 Window* NewWindow() { return NewWindow(nullptr); }
206 Window* NewWindow( 212 Window* NewWindow(
207 const std::map<std::string, std::vector<uint8_t>>* properties); 213 const std::map<std::string, std::vector<uint8_t>>* properties,
214 bool container = false);
208 Window* NewTopLevelWindow( 215 Window* NewTopLevelWindow(
209 const std::map<std::string, std::vector<uint8_t>>* properties); 216 const std::map<std::string, std::vector<uint8_t>>* properties);
210 217
211 void AddObserver(WindowTreeClientObserver* observer); 218 void AddObserver(WindowTreeClientObserver* observer);
212 void RemoveObserver(WindowTreeClientObserver* observer); 219 void RemoveObserver(WindowTreeClientObserver* observer);
213 220
214 #if !defined(NDEBUG) 221 #if !defined(NDEBUG)
215 std::string GetDebugWindowHierarchy() const; 222 std::string GetDebugWindowHierarchy() const;
216 void BuildDebugInfo(const std::string& depth, 223 void BuildDebugInfo(const std::string& depth,
217 Window* window, 224 Window* window,
(...skipping 26 matching lines...) Expand all
244 // if there is no InFlightChange matching |change|. 251 // if there is no InFlightChange matching |change|.
245 // See InFlightChange for details on how InFlightChanges are used. 252 // See InFlightChange for details on how InFlightChanges are used.
246 bool ApplyServerChangeToExistingInFlightChange(const InFlightChange& change); 253 bool ApplyServerChangeToExistingInFlightChange(const InFlightChange& change);
247 254
248 static Id server_id(const Window* window) { return window->server_id(); } 255 static Id server_id(const Window* window) { return window->server_id(); }
249 256
250 Window* BuildWindowTree(const mojo::Array<mojom::WindowDataPtr>& windows, 257 Window* BuildWindowTree(const mojo::Array<mojom::WindowDataPtr>& windows,
251 Window* initial_parent); 258 Window* initial_parent);
252 259
253 Window* NewWindowImpl(NewWindowType type, 260 Window* NewWindowImpl(NewWindowType type,
254 const Window::SharedProperties* properties); 261 const Window::SharedProperties* properties,
262 bool container = false);
255 263
256 // Sets the mojom::WindowTree implementation. 264 // Sets the mojom::WindowTree implementation.
257 void SetWindowTree(mojom::WindowTreePtr window_tree_ptr); 265 void SetWindowTree(mojom::WindowTreePtr window_tree_ptr);
258 266
259 // Called when the mojom::WindowTree connection is lost, deletes this. 267 // Called when the mojom::WindowTree connection is lost, deletes this.
260 void OnConnectionLost(); 268 void OnConnectionLost();
261 269
262 // OnEmbed() calls into this. Exposed as a separate function for testing. 270 // OnEmbed() calls into this. Exposed as a separate function for testing.
263 void OnEmbedImpl(mojom::WindowTree* window_tree, 271 void OnEmbedImpl(mojom::WindowTree* window_tree,
264 ClientSpecificId client_id, 272 ClientSpecificId client_id,
(...skipping 23 matching lines...) Expand all
288 void OnUnembed(Id window_id) override; 296 void OnUnembed(Id window_id) override;
289 void OnCaptureChanged(Id new_capture_window_id, 297 void OnCaptureChanged(Id new_capture_window_id,
290 Id old_capture_window_id) override; 298 Id old_capture_window_id) override;
291 void OnTopLevelCreated(uint32_t change_id, 299 void OnTopLevelCreated(uint32_t change_id,
292 mojom::WindowDataPtr data, 300 mojom::WindowDataPtr data,
293 int64_t display_id, 301 int64_t display_id,
294 bool drawn) override; 302 bool drawn) override;
295 void OnWindowBoundsChanged(Id window_id, 303 void OnWindowBoundsChanged(Id window_id,
296 const gfx::Rect& old_bounds, 304 const gfx::Rect& old_bounds,
297 const gfx::Rect& new_bounds) override; 305 const gfx::Rect& new_bounds) override;
306 void OnWindowSurfaceCreated(
307 Id window_id,
308 const gfx::Size& size,
309 float device_scale_factor,
310 const cc::SurfaceId& surface_id,
311 const cc::SurfaceSequence& surface_sequence) override;
298 void OnClientAreaChanged( 312 void OnClientAreaChanged(
299 uint32_t window_id, 313 uint32_t window_id,
300 const gfx::Insets& new_client_area, 314 const gfx::Insets& new_client_area,
301 mojo::Array<gfx::Rect> new_additional_client_areas) override; 315 mojo::Array<gfx::Rect> new_additional_client_areas) override;
302 void OnTransientWindowAdded(uint32_t window_id, 316 void OnTransientWindowAdded(uint32_t window_id,
303 uint32_t transient_window_id) override; 317 uint32_t transient_window_id) override;
304 void OnTransientWindowRemoved(uint32_t window_id, 318 void OnTransientWindowRemoved(uint32_t window_id,
305 uint32_t transient_window_id) override; 319 uint32_t transient_window_id) override;
306 void OnWindowHierarchyChanged( 320 void OnWindowHierarchyChanged(
307 Id window_id, 321 Id window_id,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 std::set<Id> drag_entered_windows_; 493 std::set<Id> drag_entered_windows_;
480 494
481 base::WeakPtrFactory<WindowTreeClient> weak_factory_; 495 base::WeakPtrFactory<WindowTreeClient> weak_factory_;
482 496
483 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); 497 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient);
484 }; 498 };
485 499
486 } // namespace ui 500 } // namespace ui
487 501
488 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_H_ 502 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/window_private.h ('k') | services/ui/public/cpp/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698