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

Side by Side Diff: ui/aura/mus/window_tree_client.h

Issue 2886873002: Only send the FrameSinkId to client when it is necessary (Closed)
Patch Set: Address review issues. Created 3 years, 7 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 | « ui/aura/mus/window_port_mus.cc ('k') | ui/aura/mus/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 UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ 5 #ifndef UI_AURA_MUS_WINDOW_TREE_CLIENT_H_
6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ 6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Sets local properties on the associated Window from the server properties. 231 // Sets local properties on the associated Window from the server properties.
232 void SetLocalPropertiesFromServerProperties( 232 void SetLocalPropertiesFromServerProperties(
233 WindowMus* window, 233 WindowMus* window,
234 const ui::mojom::WindowData& window_data); 234 const ui::mojom::WindowData& window_data);
235 235
236 // Creates a new WindowTreeHostMus. 236 // Creates a new WindowTreeHostMus.
237 std::unique_ptr<WindowTreeHostMus> CreateWindowTreeHost( 237 std::unique_ptr<WindowTreeHostMus> CreateWindowTreeHost(
238 WindowMusType window_mus_type, 238 WindowMusType window_mus_type,
239 const ui::mojom::WindowData& window_data, 239 const ui::mojom::WindowData& window_data,
240 int64_t display_id, 240 int64_t display_id,
241 const cc::FrameSinkId& frame_sink_id = cc::FrameSinkId(),
242 const base::Optional<cc::LocalSurfaceId>& local_surface_id = 241 const base::Optional<cc::LocalSurfaceId>& local_surface_id =
243 base::nullopt); 242 base::nullopt);
244 243
245 WindowMus* NewWindowFromWindowData(WindowMus* parent, 244 WindowMus* NewWindowFromWindowData(WindowMus* parent,
246 const ui::mojom::WindowData& window_data); 245 const ui::mojom::WindowData& window_data);
247 246
248 // Sets the ui::mojom::WindowTree implementation. 247 // Sets the ui::mojom::WindowTree implementation.
249 void SetWindowTree(ui::mojom::WindowTreePtr window_tree_ptr); 248 void SetWindowTree(ui::mojom::WindowTreePtr window_tree_ptr);
250 249
251 // Called when the connection to the server is established. 250 // Called when the connection to the server is established.
252 void WindowTreeConnectionEstablished(ui::mojom::WindowTree* window_tree); 251 void WindowTreeConnectionEstablished(ui::mojom::WindowTree* window_tree);
253 252
254 // Called when the ui::mojom::WindowTree connection is lost, deletes this. 253 // Called when the ui::mojom::WindowTree connection is lost, deletes this.
255 void OnConnectionLost(); 254 void OnConnectionLost();
256 255
257 // Called when a Window property changes. If |key| is handled internally 256 // Called when a Window property changes. If |key| is handled internally
258 // (maps to a function on WindowTree) returns true. 257 // (maps to a function on WindowTree) returns true.
259 bool HandleInternalPropertyChanged(WindowMus* window, 258 bool HandleInternalPropertyChanged(WindowMus* window,
260 const void* key, 259 const void* key,
261 int64_t old_value); 260 int64_t old_value);
262 261
263 // OnEmbed() calls into this. Exposed as a separate function for testing. 262 // OnEmbed() calls into this. Exposed as a separate function for testing.
264 void OnEmbedImpl(ui::mojom::WindowTree* window_tree, 263 void OnEmbedImpl(ui::mojom::WindowTree* window_tree,
265 ClientSpecificId client_id, 264 ClientSpecificId client_id,
266 ui::mojom::WindowDataPtr root_data, 265 ui::mojom::WindowDataPtr root_data,
267 int64_t display_id, 266 int64_t display_id,
268 Id focused_window_id, 267 Id focused_window_id,
269 bool drawn, 268 bool drawn,
270 const cc::FrameSinkId& frame_sink_id,
271 const base::Optional<cc::LocalSurfaceId>& local_surface_id); 269 const base::Optional<cc::LocalSurfaceId>& local_surface_id);
272 270
273 // Called once mus acks the call to SetDisplayRoot(). 271 // Called once mus acks the call to SetDisplayRoot().
274 void OnSetDisplayRootDone( 272 void OnSetDisplayRootDone(bool success);
275 Id window_id,
276 const base::Optional<cc::FrameSinkId>& frame_sink_id);
277 273
278 // Called by WmNewDisplayAdded(). 274 // Called by WmNewDisplayAdded().
279 WindowTreeHostMus* WmNewDisplayAddedImpl( 275 WindowTreeHostMus* WmNewDisplayAddedImpl(
280 const display::Display& display, 276 const display::Display& display,
281 ui::mojom::WindowDataPtr root_data, 277 ui::mojom::WindowDataPtr root_data,
282 bool parent_drawn, 278 bool parent_drawn,
283 const cc::FrameSinkId& frame_sink_id,
284 const base::Optional<cc::LocalSurfaceId>& local_surface_id); 279 const base::Optional<cc::LocalSurfaceId>& local_surface_id);
285 280
286 std::unique_ptr<EventResultCallback> CreateEventResultCallback( 281 std::unique_ptr<EventResultCallback> CreateEventResultCallback(
287 int32_t event_id); 282 int32_t event_id);
288 283
289 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); 284 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle);
290 285
291 // Called when a property needs to change as the result of a change in the 286 // Called when a property needs to change as the result of a change in the
292 // server, or the server failing to accept a change. 287 // server, or the server failing to accept a change.
293 void SetWindowBoundsFromServer( 288 void SetWindowBoundsFromServer(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 void OnWmMoveLoopCompleted(uint32_t change_id, bool completed); 320 void OnWmMoveLoopCompleted(uint32_t change_id, bool completed);
326 321
327 // Overridden from WindowTreeClient: 322 // Overridden from WindowTreeClient:
328 void OnEmbed( 323 void OnEmbed(
329 ClientSpecificId client_id, 324 ClientSpecificId client_id,
330 ui::mojom::WindowDataPtr root, 325 ui::mojom::WindowDataPtr root,
331 ui::mojom::WindowTreePtr tree, 326 ui::mojom::WindowTreePtr tree,
332 int64_t display_id, 327 int64_t display_id,
333 Id focused_window_id, 328 Id focused_window_id,
334 bool drawn, 329 bool drawn,
335 const cc::FrameSinkId& frame_sink_id,
336 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override; 330 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override;
337 void OnEmbeddedAppDisconnected(Id window_id) override; 331 void OnEmbeddedAppDisconnected(Id window_id) override;
338 void OnUnembed(Id window_id) override; 332 void OnUnembed(Id window_id) override;
339 void OnCaptureChanged(Id new_capture_window_id, 333 void OnCaptureChanged(Id new_capture_window_id,
340 Id old_capture_window_id) override; 334 Id old_capture_window_id) override;
341 void OnFrameSinkIdAllocated(Id window_id, 335 void OnFrameSinkIdAllocated(Id window_id,
342 const cc::FrameSinkId& frame_sink_id) override; 336 const cc::FrameSinkId& frame_sink_id) override;
343 void OnTopLevelCreated( 337 void OnTopLevelCreated(
344 uint32_t change_id, 338 uint32_t change_id,
345 ui::mojom::WindowDataPtr data, 339 ui::mojom::WindowDataPtr data,
346 int64_t display_id, 340 int64_t display_id,
347 bool drawn, 341 bool drawn,
348 const cc::FrameSinkId& frame_sink_id,
349 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override; 342 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override;
350 void OnWindowBoundsChanged( 343 void OnWindowBoundsChanged(
351 Id window_id, 344 Id window_id,
352 const gfx::Rect& old_bounds, 345 const gfx::Rect& old_bounds,
353 const gfx::Rect& new_bounds, 346 const gfx::Rect& new_bounds,
354 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override; 347 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override;
355 void OnClientAreaChanged( 348 void OnClientAreaChanged(
356 uint32_t window_id, 349 uint32_t window_id,
357 const gfx::Insets& new_client_area, 350 const gfx::Insets& new_client_area,
358 const std::vector<gfx::Rect>& new_additional_client_areas) override; 351 const std::vector<gfx::Rect>& new_additional_client_areas) override;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void RequestClose(uint32_t window_id) override; 410 void RequestClose(uint32_t window_id) override;
418 void GetWindowManager( 411 void GetWindowManager(
419 mojo::AssociatedInterfaceRequest<WindowManager> internal) override; 412 mojo::AssociatedInterfaceRequest<WindowManager> internal) override;
420 413
421 // Overridden from WindowManager: 414 // Overridden from WindowManager:
422 void OnConnect(ClientSpecificId client_id) override; 415 void OnConnect(ClientSpecificId client_id) override;
423 void WmNewDisplayAdded( 416 void WmNewDisplayAdded(
424 const display::Display& display, 417 const display::Display& display,
425 ui::mojom::WindowDataPtr root_data, 418 ui::mojom::WindowDataPtr root_data,
426 bool parent_drawn, 419 bool parent_drawn,
427 const cc::FrameSinkId& frame_sink_id,
428 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override; 420 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override;
429 void WmDisplayRemoved(int64_t display_id) override; 421 void WmDisplayRemoved(int64_t display_id) override;
430 void WmDisplayModified(const display::Display& display) override; 422 void WmDisplayModified(const display::Display& display) override;
431 void WmSetBounds(uint32_t change_id, 423 void WmSetBounds(uint32_t change_id,
432 Id window_id, 424 Id window_id,
433 const gfx::Rect& transit_bounds_in_pixels) override; 425 const gfx::Rect& transit_bounds_in_pixels) override;
434 void WmSetProperty( 426 void WmSetProperty(
435 uint32_t change_id, 427 uint32_t change_id,
436 Id window_id, 428 Id window_id,
437 const std::string& name, 429 const std::string& name,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 gfx::Insets normal_client_area_insets_; 635 gfx::Insets normal_client_area_insets_;
644 636
645 base::WeakPtrFactory<WindowTreeClient> weak_factory_; 637 base::WeakPtrFactory<WindowTreeClient> weak_factory_;
646 638
647 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); 639 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient);
648 }; 640 };
649 641
650 } // namespace aura 642 } // namespace aura
651 643
652 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ 644 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_
OLDNEW
« no previous file with comments | « ui/aura/mus/window_port_mus.cc ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698