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

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

Issue 1775133003: Moves EventDispatcher from Display to WindowManagerState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo Created 4 years, 9 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 | « components/mus/ws/window_manager_state.cc ('k') | components/mus/ws/window_tree.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 COMPONENTS_MUS_WS_WINDOW_TREE_H_ 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_H_
6 #define COMPONENTS_MUS_WS_WINDOW_TREE_H_ 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 std::set<const ServerWindow*> roots() { return roots_; } 102 std::set<const ServerWindow*> roots() { return roots_; }
103 103
104 bool is_embed_root() const { return is_embed_root_; } 104 bool is_embed_root() const { return is_embed_root_; }
105 105
106 const Display* GetDisplay(const ServerWindow* window) const; 106 const Display* GetDisplay(const ServerWindow* window) const;
107 Display* GetDisplay(const ServerWindow* window) { 107 Display* GetDisplay(const ServerWindow* window) {
108 return const_cast<Display*>( 108 return const_cast<Display*>(
109 const_cast<const WindowTree*>(this)->GetDisplay(window)); 109 const_cast<const WindowTree*>(this)->GetDisplay(window));
110 } 110 }
111 111
112 const WindowManagerState* GetWindowManagerState(
113 const ServerWindow* window) const;
114 WindowManagerState* GetWindowManagerState(const ServerWindow* window) {
115 return const_cast<WindowManagerState*>(
116 const_cast<const WindowTree*>(this)->GetWindowManagerState(window));
117 }
118
112 // Invoked when a tree is about to be destroyed. 119 // Invoked when a tree is about to be destroyed.
113 void OnWindowDestroyingTreeImpl(WindowTree* tree); 120 void OnWindowDestroyingTreeImpl(WindowTree* tree);
114 121
115 void OnWillDestroyDisplay(Display* display);
116
117 // These functions are synchronous variants of those defined in the mojom. The 122 // These functions are synchronous variants of those defined in the mojom. The
118 // WindowTree implementations all call into these. See the mojom for details. 123 // WindowTree implementations all call into these. See the mojom for details.
124 bool SetCapture(const ClientWindowId& client_window_id);
119 bool NewWindow(const ClientWindowId& client_window_id, 125 bool NewWindow(const ClientWindowId& client_window_id,
120 const std::map<std::string, std::vector<uint8_t>>& properties); 126 const std::map<std::string, std::vector<uint8_t>>& properties);
121 bool AddWindow(const ClientWindowId& parent_id, 127 bool AddWindow(const ClientWindowId& parent_id,
122 const ClientWindowId& child_id); 128 const ClientWindowId& child_id);
123 bool AddTransientWindow(const ClientWindowId& window_id, 129 bool AddTransientWindow(const ClientWindowId& window_id,
124 const ClientWindowId& transient_window_id); 130 const ClientWindowId& transient_window_id);
125 std::vector<const ServerWindow*> GetWindowTree( 131 std::vector<const ServerWindow*> GetWindowTree(
126 const ClientWindowId& window_id) const; 132 const ClientWindowId& window_id) const;
127 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible); 133 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible);
128 bool Embed(const ClientWindowId& window_id, 134 bool Embed(const ClientWindowId& window_id,
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 base::hash_map<WindowId, ServerWindow*> created_window_map_; 405 base::hash_map<WindowId, ServerWindow*> created_window_map_;
400 406
401 // The client is allowed to assign ids. These two maps providing the mapping 407 // The client is allowed to assign ids. These two maps providing the mapping
402 // from the ids native to the server (WindowId) to those understood by the 408 // from the ids native to the server (WindowId) to those understood by the
403 // client (ClientWindowId). 409 // client (ClientWindowId).
404 base::hash_map<ClientWindowId, WindowId> client_id_to_window_id_map_; 410 base::hash_map<ClientWindowId, WindowId> client_id_to_window_id_map_;
405 base::hash_map<WindowId, ClientWindowId> window_id_to_client_id_map_; 411 base::hash_map<WindowId, ClientWindowId> window_id_to_client_id_map_;
406 412
407 uint32_t event_ack_id_; 413 uint32_t event_ack_id_;
408 414
409 // Display the current event came from. 415 // WindowManager the current event came from.
410 Display* event_source_display_; 416 WindowManagerState* event_source_wms_ = nullptr;
411 417
412 bool is_embed_root_; 418 bool is_embed_root_;
413 419
414 std::queue<scoped_ptr<TargetedEvent>> event_queue_; 420 std::queue<scoped_ptr<TargetedEvent>> event_queue_;
415 421
416 scoped_ptr<mojo::AssociatedBinding<mojom::WindowManagerClient>> 422 scoped_ptr<mojo::AssociatedBinding<mojom::WindowManagerClient>>
417 window_manager_internal_client_binding_; 423 window_manager_internal_client_binding_;
418 mojom::WindowManager* window_manager_internal_; 424 mojom::WindowManager* window_manager_internal_;
419 425
420 scoped_ptr<WaitingForTopLevelWindowInfo> waiting_for_top_level_window_info_; 426 scoped_ptr<WaitingForTopLevelWindowInfo> waiting_for_top_level_window_info_;
421 427
422 DISALLOW_COPY_AND_ASSIGN(WindowTree); 428 DISALLOW_COPY_AND_ASSIGN(WindowTree);
423 }; 429 };
424 430
425 } // namespace ws 431 } // namespace ws
426 } // namespace mus 432 } // namespace mus
427 433
428 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_H_ 434 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_H_
OLDNEW
« no previous file with comments | « components/mus/ws/window_manager_state.cc ('k') | components/mus/ws/window_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698