| OLD | NEW |
| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 void Init(std::unique_ptr<WindowTreeBinding> binding, | 72 void Init(std::unique_ptr<WindowTreeBinding> binding, |
| 73 mojom::WindowTreePtr tree); | 73 mojom::WindowTreePtr tree); |
| 74 | 74 |
| 75 // Called if this WindowTree hosts the WindowManager. This happens if | 75 // Called if this WindowTree hosts the WindowManager. This happens if |
| 76 // this WindowTree serves as the root of a WindowTreeHost. | 76 // this WindowTree serves as the root of a WindowTreeHost. |
| 77 void ConfigureWindowManager(); | 77 void ConfigureWindowManager(); |
| 78 | 78 |
| 79 ClientSpecificId id() const { return id_; } | 79 ClientSpecificId id() const { return id_; } |
| 80 | 80 |
| 81 void set_embedder_intercepts_events() { embedder_intercepts_events_ = true; } |
| 82 bool embedder_intercepts_events() const { |
| 83 return embedder_intercepts_events_; |
| 84 } |
| 85 |
| 81 const UserId& user_id() const { return user_id_; } | 86 const UserId& user_id() const { return user_id_; } |
| 82 | 87 |
| 83 mojom::WindowTreeClient* client() { return binding_->client(); } | 88 mojom::WindowTreeClient* client() { return binding_->client(); } |
| 84 | 89 |
| 85 // Returns the Window with the specified id. | 90 // Returns the Window with the specified id. |
| 86 ServerWindow* GetWindow(const WindowId& id) { | 91 ServerWindow* GetWindow(const WindowId& id) { |
| 87 return const_cast<ServerWindow*>( | 92 return const_cast<ServerWindow*>( |
| 88 const_cast<const WindowTree*>(this)->GetWindow(id)); | 93 const_cast<const WindowTree*>(this)->GetWindow(id)); |
| 89 } | 94 } |
| 90 const ServerWindow* GetWindow(const WindowId& id) const; | 95 const ServerWindow* GetWindow(const WindowId& id) const; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 const ClientWindowId& child_id); | 146 const ClientWindowId& child_id); |
| 142 bool AddTransientWindow(const ClientWindowId& window_id, | 147 bool AddTransientWindow(const ClientWindowId& window_id, |
| 143 const ClientWindowId& transient_window_id); | 148 const ClientWindowId& transient_window_id); |
| 144 bool SetModal(const ClientWindowId& window_id); | 149 bool SetModal(const ClientWindowId& window_id); |
| 145 std::vector<const ServerWindow*> GetWindowTree( | 150 std::vector<const ServerWindow*> GetWindowTree( |
| 146 const ClientWindowId& window_id) const; | 151 const ClientWindowId& window_id) const; |
| 147 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible); | 152 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible); |
| 148 bool SetWindowOpacity(const ClientWindowId& window_id, float opacity); | 153 bool SetWindowOpacity(const ClientWindowId& window_id, float opacity); |
| 149 bool SetFocus(const ClientWindowId& window_id); | 154 bool SetFocus(const ClientWindowId& window_id); |
| 150 bool Embed(const ClientWindowId& window_id, | 155 bool Embed(const ClientWindowId& window_id, |
| 151 mojom::WindowTreeClientPtr client); | 156 mojom::WindowTreeClientPtr client, |
| 157 uint32_t flags); |
| 152 void DispatchInputEvent(ServerWindow* target, const ui::Event& event); | 158 void DispatchInputEvent(ServerWindow* target, const ui::Event& event); |
| 153 | 159 |
| 154 bool IsWaitingForNewTopLevelWindow(uint32_t wm_change_id); | 160 bool IsWaitingForNewTopLevelWindow(uint32_t wm_change_id); |
| 155 void OnWindowManagerCreatedTopLevelWindow(uint32_t wm_change_id, | 161 void OnWindowManagerCreatedTopLevelWindow(uint32_t wm_change_id, |
| 156 uint32_t client_change_id, | 162 uint32_t client_change_id, |
| 157 const ServerWindow* window); | 163 const ServerWindow* window); |
| 158 void AddActivationParent(const ClientWindowId& window_id); | 164 void AddActivationParent(const ClientWindowId& window_id); |
| 159 | 165 |
| 160 // Calls through to the client. | 166 // Calls through to the client. |
| 161 void OnChangeCompleted(uint32_t change_id, bool success); | 167 void OnChangeCompleted(uint32_t change_id, bool success); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 mojo::Array<uint8_t> value) override; | 366 mojo::Array<uint8_t> value) override; |
| 361 void SetWindowOpacity(uint32_t change_id, | 367 void SetWindowOpacity(uint32_t change_id, |
| 362 Id window_id, | 368 Id window_id, |
| 363 float opacity) override; | 369 float opacity) override; |
| 364 void AttachSurface(Id transport_window_id, | 370 void AttachSurface(Id transport_window_id, |
| 365 mojom::SurfaceType type, | 371 mojom::SurfaceType type, |
| 366 mojo::InterfaceRequest<mojom::Surface> surface, | 372 mojo::InterfaceRequest<mojom::Surface> surface, |
| 367 mojom::SurfaceClientPtr client) override; | 373 mojom::SurfaceClientPtr client) override; |
| 368 void Embed(Id transport_window_id, | 374 void Embed(Id transport_window_id, |
| 369 mojom::WindowTreeClientPtr client, | 375 mojom::WindowTreeClientPtr client, |
| 376 uint32_t flags, |
| 370 const EmbedCallback& callback) override; | 377 const EmbedCallback& callback) override; |
| 371 void SetFocus(uint32_t change_id, Id transport_window_id) override; | 378 void SetFocus(uint32_t change_id, Id transport_window_id) override; |
| 372 void SetCanFocus(Id transport_window_id, bool can_focus) override; | 379 void SetCanFocus(Id transport_window_id, bool can_focus) override; |
| 373 void SetPredefinedCursor(uint32_t change_id, | 380 void SetPredefinedCursor(uint32_t change_id, |
| 374 Id transport_window_id, | 381 Id transport_window_id, |
| 375 mus::mojom::Cursor cursor_id) override; | 382 mus::mojom::Cursor cursor_id) override; |
| 376 void SetWindowTextInputState(Id transport_window_id, | 383 void SetWindowTextInputState(Id transport_window_id, |
| 377 mojo::TextInputStatePtr state) override; | 384 mojo::TextInputStatePtr state) override; |
| 378 void SetImeVisibility(Id transport_window_id, | 385 void SetImeVisibility(Id transport_window_id, |
| 379 bool visible, | 386 bool visible, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 WindowManagerState* event_source_wms_ = nullptr; | 470 WindowManagerState* event_source_wms_ = nullptr; |
| 464 | 471 |
| 465 std::queue<std::unique_ptr<TargetedEvent>> event_queue_; | 472 std::queue<std::unique_ptr<TargetedEvent>> event_queue_; |
| 466 | 473 |
| 467 std::unique_ptr<mojo::AssociatedBinding<mojom::WindowManagerClient>> | 474 std::unique_ptr<mojo::AssociatedBinding<mojom::WindowManagerClient>> |
| 468 window_manager_internal_client_binding_; | 475 window_manager_internal_client_binding_; |
| 469 mojom::WindowManager* window_manager_internal_; | 476 mojom::WindowManager* window_manager_internal_; |
| 470 | 477 |
| 471 std::unique_ptr<WaitingForTopLevelWindowInfo> | 478 std::unique_ptr<WaitingForTopLevelWindowInfo> |
| 472 waiting_for_top_level_window_info_; | 479 waiting_for_top_level_window_info_; |
| 480 bool embedder_intercepts_events_ = false; |
| 473 | 481 |
| 474 DISALLOW_COPY_AND_ASSIGN(WindowTree); | 482 DISALLOW_COPY_AND_ASSIGN(WindowTree); |
| 475 }; | 483 }; |
| 476 | 484 |
| 477 } // namespace ws | 485 } // namespace ws |
| 478 } // namespace mus | 486 } // namespace mus |
| 479 | 487 |
| 480 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_H_ | 488 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_H_ |
| OLD | NEW |