| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 ~WindowTree() override; | 72 ~WindowTree() override; |
| 73 | 73 |
| 74 void Init(std::unique_ptr<WindowTreeBinding> binding, | 74 void Init(std::unique_ptr<WindowTreeBinding> binding, |
| 75 mojom::WindowTreePtr tree); | 75 mojom::WindowTreePtr tree); |
| 76 | 76 |
| 77 // Called if this WindowTree hosts a WindowManager. | 77 // Called if this WindowTree hosts a WindowManager. |
| 78 void ConfigureWindowManager(); | 78 void ConfigureWindowManager(); |
| 79 | 79 |
| 80 ClientSpecificId id() const { return id_; } | 80 ClientSpecificId id() const { return id_; } |
| 81 | 81 |
| 82 void set_embedder_intercepts_events() { embedder_intercepts_events_ = true; } |
| 83 bool embedder_intercepts_events() const { |
| 84 return embedder_intercepts_events_; |
| 85 } |
| 86 |
| 82 const UserId& user_id() const { return user_id_; } | 87 const UserId& user_id() const { return user_id_; } |
| 83 | 88 |
| 84 mojom::WindowTreeClient* client() { return binding_->client(); } | 89 mojom::WindowTreeClient* client() { return binding_->client(); } |
| 85 | 90 |
| 86 // Returns the Window with the specified id. | 91 // Returns the Window with the specified id. |
| 87 ServerWindow* GetWindow(const WindowId& id) { | 92 ServerWindow* GetWindow(const WindowId& id) { |
| 88 return const_cast<ServerWindow*>( | 93 return const_cast<ServerWindow*>( |
| 89 const_cast<const WindowTree*>(this)->GetWindow(id)); | 94 const_cast<const WindowTree*>(this)->GetWindow(id)); |
| 90 } | 95 } |
| 91 const ServerWindow* GetWindow(const WindowId& id) const; | 96 const ServerWindow* GetWindow(const WindowId& id) const; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 const ClientWindowId& child_id); | 161 const ClientWindowId& child_id); |
| 157 bool AddTransientWindow(const ClientWindowId& window_id, | 162 bool AddTransientWindow(const ClientWindowId& window_id, |
| 158 const ClientWindowId& transient_window_id); | 163 const ClientWindowId& transient_window_id); |
| 159 bool SetModal(const ClientWindowId& window_id); | 164 bool SetModal(const ClientWindowId& window_id); |
| 160 std::vector<const ServerWindow*> GetWindowTree( | 165 std::vector<const ServerWindow*> GetWindowTree( |
| 161 const ClientWindowId& window_id) const; | 166 const ClientWindowId& window_id) const; |
| 162 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible); | 167 bool SetWindowVisibility(const ClientWindowId& window_id, bool visible); |
| 163 bool SetWindowOpacity(const ClientWindowId& window_id, float opacity); | 168 bool SetWindowOpacity(const ClientWindowId& window_id, float opacity); |
| 164 bool SetFocus(const ClientWindowId& window_id); | 169 bool SetFocus(const ClientWindowId& window_id); |
| 165 bool Embed(const ClientWindowId& window_id, | 170 bool Embed(const ClientWindowId& window_id, |
| 166 mojom::WindowTreeClientPtr client); | 171 mojom::WindowTreeClientPtr client, |
| 172 uint32_t flags); |
| 167 void DispatchInputEvent(ServerWindow* target, const ui::Event& event); | 173 void DispatchInputEvent(ServerWindow* target, const ui::Event& event); |
| 168 | 174 |
| 169 bool IsWaitingForNewTopLevelWindow(uint32_t wm_change_id); | 175 bool IsWaitingForNewTopLevelWindow(uint32_t wm_change_id); |
| 170 void OnWindowManagerCreatedTopLevelWindow(uint32_t wm_change_id, | 176 void OnWindowManagerCreatedTopLevelWindow(uint32_t wm_change_id, |
| 171 uint32_t client_change_id, | 177 uint32_t client_change_id, |
| 172 const ServerWindow* window); | 178 const ServerWindow* window); |
| 173 void AddActivationParent(const ClientWindowId& window_id); | 179 void AddActivationParent(const ClientWindowId& window_id); |
| 174 | 180 |
| 175 // Calls through to the client. | 181 // Calls through to the client. |
| 176 void OnChangeCompleted(uint32_t change_id, bool success); | 182 void OnChangeCompleted(uint32_t change_id, bool success); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 mojo::Array<uint8_t> value) override; | 374 mojo::Array<uint8_t> value) override; |
| 369 void SetWindowOpacity(uint32_t change_id, | 375 void SetWindowOpacity(uint32_t change_id, |
| 370 Id window_id, | 376 Id window_id, |
| 371 float opacity) override; | 377 float opacity) override; |
| 372 void AttachSurface(Id transport_window_id, | 378 void AttachSurface(Id transport_window_id, |
| 373 mojom::SurfaceType type, | 379 mojom::SurfaceType type, |
| 374 mojo::InterfaceRequest<mojom::Surface> surface, | 380 mojo::InterfaceRequest<mojom::Surface> surface, |
| 375 mojom::SurfaceClientPtr client) override; | 381 mojom::SurfaceClientPtr client) override; |
| 376 void Embed(Id transport_window_id, | 382 void Embed(Id transport_window_id, |
| 377 mojom::WindowTreeClientPtr client, | 383 mojom::WindowTreeClientPtr client, |
| 384 uint32_t flags, |
| 378 const EmbedCallback& callback) override; | 385 const EmbedCallback& callback) override; |
| 379 void SetFocus(uint32_t change_id, Id transport_window_id) override; | 386 void SetFocus(uint32_t change_id, Id transport_window_id) override; |
| 380 void SetCanFocus(Id transport_window_id, bool can_focus) override; | 387 void SetCanFocus(Id transport_window_id, bool can_focus) override; |
| 381 void SetPredefinedCursor(uint32_t change_id, | 388 void SetPredefinedCursor(uint32_t change_id, |
| 382 Id transport_window_id, | 389 Id transport_window_id, |
| 383 mus::mojom::Cursor cursor_id) override; | 390 mus::mojom::Cursor cursor_id) override; |
| 384 void SetWindowTextInputState(Id transport_window_id, | 391 void SetWindowTextInputState(Id transport_window_id, |
| 385 mojo::TextInputStatePtr state) override; | 392 mojo::TextInputStatePtr state) override; |
| 386 void SetImeVisibility(Id transport_window_id, | 393 void SetImeVisibility(Id transport_window_id, |
| 387 bool visible, | 394 bool visible, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 479 |
| 473 std::queue<std::unique_ptr<TargetedEvent>> event_queue_; | 480 std::queue<std::unique_ptr<TargetedEvent>> event_queue_; |
| 474 | 481 |
| 475 std::unique_ptr<mojo::AssociatedBinding<mojom::WindowManagerClient>> | 482 std::unique_ptr<mojo::AssociatedBinding<mojom::WindowManagerClient>> |
| 476 window_manager_internal_client_binding_; | 483 window_manager_internal_client_binding_; |
| 477 mojom::WindowManager* window_manager_internal_; | 484 mojom::WindowManager* window_manager_internal_; |
| 478 std::unique_ptr<WindowManagerState> window_manager_state_; | 485 std::unique_ptr<WindowManagerState> window_manager_state_; |
| 479 | 486 |
| 480 std::unique_ptr<WaitingForTopLevelWindowInfo> | 487 std::unique_ptr<WaitingForTopLevelWindowInfo> |
| 481 waiting_for_top_level_window_info_; | 488 waiting_for_top_level_window_info_; |
| 489 bool embedder_intercepts_events_ = false; |
| 482 | 490 |
| 483 DISALLOW_COPY_AND_ASSIGN(WindowTree); | 491 DISALLOW_COPY_AND_ASSIGN(WindowTree); |
| 484 }; | 492 }; |
| 485 | 493 |
| 486 } // namespace ws | 494 } // namespace ws |
| 487 } // namespace mus | 495 } // namespace mus |
| 488 | 496 |
| 489 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_H_ | 497 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_H_ |
| OLD | NEW |