| 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 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 // Sets local properties on the associated Window from the server properties. | 225 // Sets local properties on the associated Window from the server properties. |
| 226 void SetLocalPropertiesFromServerProperties( | 226 void SetLocalPropertiesFromServerProperties( |
| 227 WindowMus* window, | 227 WindowMus* window, |
| 228 const ui::mojom::WindowData& window_data); | 228 const ui::mojom::WindowData& window_data); |
| 229 | 229 |
| 230 // Creates a new WindowTreeHostMus. | 230 // Creates a new WindowTreeHostMus. |
| 231 std::unique_ptr<WindowTreeHostMus> CreateWindowTreeHost( | 231 std::unique_ptr<WindowTreeHostMus> CreateWindowTreeHost( |
| 232 WindowMusType window_mus_type, | 232 WindowMusType window_mus_type, |
| 233 const ui::mojom::WindowData& window_data, | 233 const ui::mojom::WindowData& window_data, |
| 234 int64_t display_id); | 234 int64_t display_id, |
| 235 const cc::FrameSinkId& frame_sink_id); |
| 235 | 236 |
| 236 WindowMus* NewWindowFromWindowData(WindowMus* parent, | 237 WindowMus* NewWindowFromWindowData(WindowMus* parent, |
| 237 const ui::mojom::WindowData& window_data); | 238 const ui::mojom::WindowData& window_data); |
| 238 | 239 |
| 239 // Sets the ui::mojom::WindowTree implementation. | 240 // Sets the ui::mojom::WindowTree implementation. |
| 240 void SetWindowTree(ui::mojom::WindowTreePtr window_tree_ptr); | 241 void SetWindowTree(ui::mojom::WindowTreePtr window_tree_ptr); |
| 241 | 242 |
| 242 // Called when the connection to the server is established. | 243 // Called when the connection to the server is established. |
| 243 void WindowTreeConnectionEstablished(ui::mojom::WindowTree* window_tree); | 244 void WindowTreeConnectionEstablished(ui::mojom::WindowTree* window_tree); |
| 244 | 245 |
| 245 // Called when the ui::mojom::WindowTree connection is lost, deletes this. | 246 // Called when the ui::mojom::WindowTree connection is lost, deletes this. |
| 246 void OnConnectionLost(); | 247 void OnConnectionLost(); |
| 247 | 248 |
| 248 // Called when a Window property changes. If |key| is handled internally | 249 // Called when a Window property changes. If |key| is handled internally |
| 249 // (maps to a function on WindowTree) returns true. | 250 // (maps to a function on WindowTree) returns true. |
| 250 bool HandleInternalPropertyChanged(WindowMus* window, | 251 bool HandleInternalPropertyChanged(WindowMus* window, |
| 251 const void* key, | 252 const void* key, |
| 252 int64_t old_value); | 253 int64_t old_value); |
| 253 | 254 |
| 254 // OnEmbed() calls into this. Exposed as a separate function for testing. | 255 // OnEmbed() calls into this. Exposed as a separate function for testing. |
| 255 void OnEmbedImpl(ui::mojom::WindowTree* window_tree, | 256 void OnEmbedImpl(ui::mojom::WindowTree* window_tree, |
| 256 ClientSpecificId client_id, | 257 ClientSpecificId client_id, |
| 257 ui::mojom::WindowDataPtr root_data, | 258 ui::mojom::WindowDataPtr root_data, |
| 258 int64_t display_id, | 259 int64_t display_id, |
| 259 Id focused_window_id, | 260 Id focused_window_id, |
| 260 bool drawn); | 261 bool drawn, |
| 262 const cc::FrameSinkId& frame_sink_id); |
| 261 | 263 |
| 262 // Called by WmNewDisplayAdded(). | 264 // Called by WmNewDisplayAdded(). |
| 263 WindowTreeHostMus* WmNewDisplayAddedImpl(const display::Display& display, | 265 WindowTreeHostMus* WmNewDisplayAddedImpl( |
| 264 ui::mojom::WindowDataPtr root_data, | 266 const display::Display& display, |
| 265 bool parent_drawn); | 267 ui::mojom::WindowDataPtr root_data, |
| 268 bool parent_drawn, |
| 269 const cc::FrameSinkId& frame_sink_id); |
| 266 | 270 |
| 267 std::unique_ptr<EventResultCallback> CreateEventResultCallback( | 271 std::unique_ptr<EventResultCallback> CreateEventResultCallback( |
| 268 int32_t event_id); | 272 int32_t event_id); |
| 269 | 273 |
| 270 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); | 274 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); |
| 271 | 275 |
| 272 // Called when a property needs to change as the result of a change in the | 276 // Called when a property needs to change as the result of a change in the |
| 273 // server, or the server failing to accept a change. | 277 // server, or the server failing to accept a change. |
| 274 void SetWindowBoundsFromServer(WindowMus* window, | 278 void SetWindowBoundsFromServer(WindowMus* window, |
| 275 const gfx::Rect& revert_bounds_in_pixels); | 279 const gfx::Rect& revert_bounds_in_pixels); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 302 | 306 |
| 303 // Callback passed from WmPerformMoveLoop(). | 307 // Callback passed from WmPerformMoveLoop(). |
| 304 void OnWmMoveLoopCompleted(uint32_t change_id, bool completed); | 308 void OnWmMoveLoopCompleted(uint32_t change_id, bool completed); |
| 305 | 309 |
| 306 // Overridden from WindowTreeClient: | 310 // Overridden from WindowTreeClient: |
| 307 void OnEmbed(ClientSpecificId client_id, | 311 void OnEmbed(ClientSpecificId client_id, |
| 308 ui::mojom::WindowDataPtr root, | 312 ui::mojom::WindowDataPtr root, |
| 309 ui::mojom::WindowTreePtr tree, | 313 ui::mojom::WindowTreePtr tree, |
| 310 int64_t display_id, | 314 int64_t display_id, |
| 311 Id focused_window_id, | 315 Id focused_window_id, |
| 312 bool drawn) override; | 316 bool drawn, |
| 317 const cc::FrameSinkId& frame_sink_Id) override; |
| 313 void OnEmbeddedAppDisconnected(Id window_id) override; | 318 void OnEmbeddedAppDisconnected(Id window_id) override; |
| 314 void OnUnembed(Id window_id) override; | 319 void OnUnembed(Id window_id) override; |
| 315 void OnCaptureChanged(Id new_capture_window_id, | 320 void OnCaptureChanged(Id new_capture_window_id, |
| 316 Id old_capture_window_id) override; | 321 Id old_capture_window_id) override; |
| 317 void OnTopLevelCreated(uint32_t change_id, | 322 void OnTopLevelCreated(uint32_t change_id, |
| 318 ui::mojom::WindowDataPtr data, | 323 ui::mojom::WindowDataPtr data, |
| 319 int64_t display_id, | 324 int64_t display_id, |
| 320 bool drawn) override; | 325 bool drawn, |
| 326 const cc::FrameSinkId& frame_sink_id) override; |
| 321 void OnWindowBoundsChanged( | 327 void OnWindowBoundsChanged( |
| 322 Id window_id, | 328 Id window_id, |
| 323 const gfx::Rect& old_bounds, | 329 const gfx::Rect& old_bounds, |
| 324 const gfx::Rect& new_bounds, | 330 const gfx::Rect& new_bounds, |
| 325 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override; | 331 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override; |
| 326 void OnClientAreaChanged( | 332 void OnClientAreaChanged( |
| 327 uint32_t window_id, | 333 uint32_t window_id, |
| 328 const gfx::Insets& new_client_area, | 334 const gfx::Insets& new_client_area, |
| 329 const std::vector<gfx::Rect>& new_additional_client_areas) override; | 335 const std::vector<gfx::Rect>& new_additional_client_areas) override; |
| 330 void OnTransientWindowAdded(uint32_t window_id, | 336 void OnTransientWindowAdded(uint32_t window_id, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 void OnDragDropDone() override; | 393 void OnDragDropDone() override; |
| 388 void OnChangeCompleted(uint32_t change_id, bool success) override; | 394 void OnChangeCompleted(uint32_t change_id, bool success) override; |
| 389 void RequestClose(uint32_t window_id) override; | 395 void RequestClose(uint32_t window_id) override; |
| 390 void GetWindowManager( | 396 void GetWindowManager( |
| 391 mojo::AssociatedInterfaceRequest<WindowManager> internal) override; | 397 mojo::AssociatedInterfaceRequest<WindowManager> internal) override; |
| 392 | 398 |
| 393 // Overridden from WindowManager: | 399 // Overridden from WindowManager: |
| 394 void OnConnect(ClientSpecificId client_id) override; | 400 void OnConnect(ClientSpecificId client_id) override; |
| 395 void WmNewDisplayAdded(const display::Display& display, | 401 void WmNewDisplayAdded(const display::Display& display, |
| 396 ui::mojom::WindowDataPtr root_data, | 402 ui::mojom::WindowDataPtr root_data, |
| 397 bool parent_drawn) override; | 403 bool parent_drawn, |
| 404 const cc::FrameSinkId& frame_sink_id) override; |
| 398 void WmDisplayRemoved(int64_t display_id) override; | 405 void WmDisplayRemoved(int64_t display_id) override; |
| 399 void WmDisplayModified(const display::Display& display) override; | 406 void WmDisplayModified(const display::Display& display) override; |
| 400 void WmSetBounds(uint32_t change_id, | 407 void WmSetBounds(uint32_t change_id, |
| 401 Id window_id, | 408 Id window_id, |
| 402 const gfx::Rect& transit_bounds_in_pixels) override; | 409 const gfx::Rect& transit_bounds_in_pixels) override; |
| 403 void WmSetProperty( | 410 void WmSetProperty( |
| 404 uint32_t change_id, | 411 uint32_t change_id, |
| 405 Id window_id, | 412 Id window_id, |
| 406 const std::string& name, | 413 const std::string& name, |
| 407 const base::Optional<std::vector<uint8_t>>& transit_data) override; | 414 const base::Optional<std::vector<uint8_t>>& transit_data) override; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 // ContextFactory that was set on Env originally. | 578 // ContextFactory that was set on Env originally. |
| 572 ui::ContextFactory* initial_context_factory_ = nullptr; | 579 ui::ContextFactory* initial_context_factory_ = nullptr; |
| 573 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 580 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
| 574 | 581 |
| 575 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 582 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
| 576 }; | 583 }; |
| 577 | 584 |
| 578 } // namespace aura | 585 } // namespace aura |
| 579 | 586 |
| 580 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 587 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |