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

Side by Side Diff: services/ui/ws/window_tree.h

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. Created 3 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 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_WS_WINDOW_TREE_H_ 5 #ifndef SERVICES_UI_WS_WINDOW_TREE_H_
6 #define SERVICES_UI_WS_WINDOW_TREE_H_ 6 #define SERVICES_UI_WS_WINDOW_TREE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void OnWindowDestroyingTreeImpl(WindowTree* tree); 160 void OnWindowDestroyingTreeImpl(WindowTree* tree);
161 161
162 // Sends updated display information. 162 // Sends updated display information.
163 void OnWmDisplayModified(const display::Display& display); 163 void OnWmDisplayModified(const display::Display& display);
164 164
165 // These functions are synchronous variants of those defined in the mojom. The 165 // These functions are synchronous variants of those defined in the mojom. The
166 // WindowTree implementations all call into these. See the mojom for details. 166 // WindowTree implementations all call into these. See the mojom for details.
167 bool SetCapture(const ClientWindowId& client_window_id); 167 bool SetCapture(const ClientWindowId& client_window_id);
168 bool ReleaseCapture(const ClientWindowId& client_window_id); 168 bool ReleaseCapture(const ClientWindowId& client_window_id);
169 bool NewWindow(const ClientWindowId& client_window_id, 169 bool NewWindow(const ClientWindowId& client_window_id,
170 const std::map<std::string, std::vector<uint8_t>>& properties); 170 const std::map<std::string, std::vector<uint8_t>>& properties,
171 const cc::LocalFrameId& local_frame_id);
171 bool AddWindow(const ClientWindowId& parent_id, 172 bool AddWindow(const ClientWindowId& parent_id,
172 const ClientWindowId& child_id); 173 const ClientWindowId& child_id);
173 bool AddTransientWindow(const ClientWindowId& window_id, 174 bool AddTransientWindow(const ClientWindowId& window_id,
174 const ClientWindowId& transient_window_id); 175 const ClientWindowId& transient_window_id);
175 bool DeleteWindow(const ClientWindowId& window_id); 176 bool DeleteWindow(const ClientWindowId& window_id);
176 bool SetModal(const ClientWindowId& window_id); 177 bool SetModal(const ClientWindowId& window_id);
177 std::vector<const ServerWindow*> GetWindowTree( 178 std::vector<const ServerWindow*> GetWindowTree(
178 const ClientWindowId& window_id) const; 179 const ClientWindowId& window_id) const;
179 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible); 180 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible);
180 bool SetWindowOpacity(const ClientWindowId& window_id, float opacity); 181 bool SetWindowOpacity(const ClientWindowId& window_id, float opacity);
(...skipping 26 matching lines...) Expand all
207 // Notifies the window manager client so it can update UI for the affected 208 // Notifies the window manager client so it can update UI for the affected
208 // window(s). 209 // window(s).
209 void ClientJankinessChanged(WindowTree* tree); 210 void ClientJankinessChanged(WindowTree* tree);
210 211
211 // The following methods are invoked after the corresponding change has been 212 // The following methods are invoked after the corresponding change has been
212 // processed. They do the appropriate bookkeeping and update the client as 213 // processed. They do the appropriate bookkeeping and update the client as
213 // necessary. 214 // necessary.
214 void ProcessWindowBoundsChanged(const ServerWindow* window, 215 void ProcessWindowBoundsChanged(const ServerWindow* window,
215 const gfx::Rect& old_bounds, 216 const gfx::Rect& old_bounds,
216 const gfx::Rect& new_bounds, 217 const gfx::Rect& new_bounds,
217 bool originated_change); 218 bool originated_change,
219 const cc::LocalFrameId& local_frame_id);
218 void ProcessClientAreaChanged( 220 void ProcessClientAreaChanged(
219 const ServerWindow* window, 221 const ServerWindow* window,
220 const gfx::Insets& new_client_area, 222 const gfx::Insets& new_client_area,
221 const std::vector<gfx::Rect>& new_additional_client_areas, 223 const std::vector<gfx::Rect>& new_additional_client_areas,
222 bool originated_change); 224 bool originated_change);
223 void ProcessWillChangeWindowHierarchy(const ServerWindow* window, 225 void ProcessWillChangeWindowHierarchy(const ServerWindow* window,
224 const ServerWindow* new_parent, 226 const ServerWindow* new_parent,
225 const ServerWindow* old_parent, 227 const ServerWindow* old_parent,
226 bool originated_change); 228 bool originated_change);
227 void ProcessWindowPropertyChanged(const ServerWindow* window, 229 void ProcessWindowPropertyChanged(const ServerWindow* window,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 369
368 // Calls OnChangeCompleted() on the client. 370 // Calls OnChangeCompleted() on the client.
369 void NotifyChangeCompleted(uint32_t change_id, 371 void NotifyChangeCompleted(uint32_t change_id,
370 mojom::WindowManagerErrorCode error_code); 372 mojom::WindowManagerErrorCode error_code);
371 373
372 // WindowTree: 374 // WindowTree:
373 void NewWindow(uint32_t change_id, 375 void NewWindow(uint32_t change_id,
374 Id transport_window_id, 376 Id transport_window_id,
375 const base::Optional< 377 const base::Optional<
376 std::unordered_map<std::string, std::vector<uint8_t>>>& 378 std::unordered_map<std::string, std::vector<uint8_t>>>&
377 transport_properties) override; 379 transport_properties,
380 const cc::LocalFrameId& local_frame_id) override;
378 void NewTopLevelWindow( 381 void NewTopLevelWindow(
379 uint32_t change_id, 382 uint32_t change_id,
380 Id transport_window_id, 383 Id transport_window_id,
381 const std::unordered_map<std::string, std::vector<uint8_t>>& 384 const std::unordered_map<std::string, std::vector<uint8_t>>&
382 transport_properties) override; 385 transport_properties) override;
383 void DeleteWindow(uint32_t change_id, Id transport_window_id) override; 386 void DeleteWindow(uint32_t change_id, Id transport_window_id) override;
384 void AddWindow(uint32_t change_id, Id parent_id, Id child_id) override; 387 void AddWindow(uint32_t change_id, Id parent_id, Id child_id) override;
385 void RemoveWindowFromParent(uint32_t change_id, Id window_id) override; 388 void RemoveWindowFromParent(uint32_t change_id, Id window_id) override;
386 void AddTransientWindow(uint32_t change_id, 389 void AddTransientWindow(uint32_t change_id,
387 Id window, 390 Id window,
388 Id transient_window) override; 391 Id transient_window) override;
389 void RemoveTransientWindowFromParent(uint32_t change_id, 392 void RemoveTransientWindowFromParent(uint32_t change_id,
390 Id transient_window_id) override; 393 Id transient_window_id) override;
391 void SetModal(uint32_t change_id, Id window_id) override; 394 void SetModal(uint32_t change_id, Id window_id) override;
392 void ReorderWindow(uint32_t change_Id, 395 void ReorderWindow(uint32_t change_Id,
393 Id window_id, 396 Id window_id,
394 Id relative_window_id, 397 Id relative_window_id,
395 mojom::OrderDirection direction) override; 398 mojom::OrderDirection direction) override;
396 void GetWindowTree( 399 void GetWindowTree(
397 Id window_id, 400 Id window_id,
398 const base::Callback<void(std::vector<mojom::WindowDataPtr>)>& callback) 401 const base::Callback<void(std::vector<mojom::WindowDataPtr>)>& callback)
399 override; 402 override;
400 void SetCapture(uint32_t change_id, Id window_id) override; 403 void SetCapture(uint32_t change_id, Id window_id) override;
401 void ReleaseCapture(uint32_t change_id, Id window_id) override; 404 void ReleaseCapture(uint32_t change_id, Id window_id) override;
402 void StartPointerWatcher(bool want_moves) override; 405 void StartPointerWatcher(bool want_moves) override;
403 void StopPointerWatcher() override; 406 void StopPointerWatcher() override;
404 void SetWindowBounds(uint32_t change_id, 407 void SetWindowBounds(uint32_t change_id,
405 Id window_id, 408 Id window_id,
406 const gfx::Rect& bounds) override; 409 const gfx::Rect& bounds,
410 const cc::LocalFrameId& local_frame_id) override;
407 void SetWindowVisibility(uint32_t change_id, 411 void SetWindowVisibility(uint32_t change_id,
408 Id window_id, 412 Id window_id,
409 bool visible) override; 413 bool visible) override;
410 void SetWindowProperty( 414 void SetWindowProperty(
411 uint32_t change_id, 415 uint32_t change_id,
412 Id transport_window_id, 416 Id transport_window_id,
413 const std::string& name, 417 const std::string& name,
414 const base::Optional<std::vector<uint8_t>>& value) override; 418 const base::Optional<std::vector<uint8_t>>& value) override;
415 void SetWindowOpacity(uint32_t change_id, 419 void SetWindowOpacity(uint32_t change_id,
416 Id window_id, 420 Id window_id,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 waiting_for_top_level_window_info_; 584 waiting_for_top_level_window_info_;
581 bool embedder_intercepts_events_ = false; 585 bool embedder_intercepts_events_ = false;
582 586
583 DISALLOW_COPY_AND_ASSIGN(WindowTree); 587 DISALLOW_COPY_AND_ASSIGN(WindowTree);
584 }; 588 };
585 589
586 } // namespace ws 590 } // namespace ws
587 } // namespace ui 591 } // namespace ui
588 592
589 #endif // SERVICES_UI_WS_WINDOW_TREE_H_ 593 #endif // SERVICES_UI_WS_WINDOW_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698