| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/atomicops.h" | 16 #include "base/atomicops.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "cc/surfaces/surface_id_allocator.h" |
| 21 #include "mojo/public/cpp/bindings/associated_binding.h" | 22 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 22 #include "mojo/public/cpp/bindings/strong_binding.h" | 23 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 23 #include "services/ui/public/interfaces/window_tree.mojom.h" | 24 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 24 #include "ui/aura/aura_export.h" | 25 #include "ui/aura/aura_export.h" |
| 25 #include "ui/aura/client/transient_window_client_observer.h" | 26 #include "ui/aura/client/transient_window_client_observer.h" |
| 26 #include "ui/aura/mus/capture_synchronizer_delegate.h" | 27 #include "ui/aura/mus/capture_synchronizer_delegate.h" |
| 27 #include "ui/aura/mus/drag_drop_controller_host.h" | 28 #include "ui/aura/mus/drag_drop_controller_host.h" |
| 28 #include "ui/aura/mus/focus_synchronizer_delegate.h" | 29 #include "ui/aura/mus/focus_synchronizer_delegate.h" |
| 29 #include "ui/aura/mus/mus_types.h" | 30 #include "ui/aura/mus/mus_types.h" |
| 30 #include "ui/aura/mus/window_manager_delegate.h" | 31 #include "ui/aura/mus/window_manager_delegate.h" |
| 31 #include "ui/aura/mus/window_tree_host_mus_delegate.h" | 32 #include "ui/aura/mus/window_tree_host_mus_delegate.h" |
| 33 #include "ui/compositor/layer_type.h" |
| 32 | 34 |
| 33 namespace display { | 35 namespace display { |
| 34 class Display; | 36 class Display; |
| 35 } | 37 } |
| 36 | 38 |
| 37 namespace gfx { | 39 namespace gfx { |
| 38 class Insets; | 40 class Insets; |
| 39 } | 41 } |
| 40 | 42 |
| 41 namespace service_manager { | 43 namespace service_manager { |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 bool parent_drawn); | 263 bool parent_drawn); |
| 262 | 264 |
| 263 std::unique_ptr<EventResultCallback> CreateEventResultCallback( | 265 std::unique_ptr<EventResultCallback> CreateEventResultCallback( |
| 264 int32_t event_id); | 266 int32_t event_id); |
| 265 | 267 |
| 266 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); | 268 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); |
| 267 | 269 |
| 268 // Called when a property needs to change as the result of a change in the | 270 // Called when a property needs to change as the result of a change in the |
| 269 // server, or the server failing to accept a change. | 271 // server, or the server failing to accept a change. |
| 270 void SetWindowBoundsFromServer(WindowMus* window, | 272 void SetWindowBoundsFromServer(WindowMus* window, |
| 271 const gfx::Rect& revert_bounds_in_pixels); | 273 const gfx::Rect& revert_bounds_in_pixels, |
| 274 const cc::LocalFrameId& local_frame_id); |
| 272 void SetWindowVisibleFromServer(WindowMus* window, bool visible); | 275 void SetWindowVisibleFromServer(WindowMus* window, bool visible); |
| 273 | 276 |
| 274 // Called from OnWindowMusBoundsChanged() and SetRootWindowBounds(). | 277 // Called from OnWindowMusBoundsChanged() and SetRootWindowBounds(). |
| 275 void ScheduleInFlightBoundsChange(WindowMus* window, | 278 void ScheduleInFlightBoundsChange(WindowMus* window, |
| 276 const gfx::Rect& old_bounds, | 279 const gfx::Rect& old_bounds, |
| 277 const gfx::Rect& new_bounds); | 280 const gfx::Rect& new_bounds); |
| 278 | 281 |
| 279 // Following are called from WindowMus. | 282 // Following are called from WindowMus. |
| 280 void OnWindowMusCreated(WindowMus* window); | 283 void OnWindowMusCreated(WindowMus* window, ui::LayerType layer_type); |
| 281 void OnWindowMusDestroyed(WindowMus* window, Origin origin); | 284 void OnWindowMusDestroyed(WindowMus* window, Origin origin); |
| 282 void OnWindowMusBoundsChanged(WindowMus* window, | 285 void OnWindowMusBoundsChanged(WindowMus* window, |
| 283 const gfx::Rect& old_bounds, | 286 const gfx::Rect& old_bounds, |
| 284 const gfx::Rect& new_bounds); | 287 const gfx::Rect& new_bounds); |
| 285 void OnWindowMusAddChild(WindowMus* parent, WindowMus* child); | 288 void OnWindowMusAddChild(WindowMus* parent, WindowMus* child); |
| 286 void OnWindowMusRemoveChild(WindowMus* parent, WindowMus* child); | 289 void OnWindowMusRemoveChild(WindowMus* parent, WindowMus* child); |
| 287 void OnWindowMusMoveChild(WindowMus* parent, | 290 void OnWindowMusMoveChild(WindowMus* parent, |
| 288 size_t current_index, | 291 size_t current_index, |
| 289 size_t dest_index); | 292 size_t dest_index); |
| 290 void OnWindowMusSetVisible(WindowMus* window, bool visible); | 293 void OnWindowMusSetVisible(WindowMus* window, bool visible); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 308 void OnEmbeddedAppDisconnected(Id window_id) override; | 311 void OnEmbeddedAppDisconnected(Id window_id) override; |
| 309 void OnUnembed(Id window_id) override; | 312 void OnUnembed(Id window_id) override; |
| 310 void OnCaptureChanged(Id new_capture_window_id, | 313 void OnCaptureChanged(Id new_capture_window_id, |
| 311 Id old_capture_window_id) override; | 314 Id old_capture_window_id) override; |
| 312 void OnTopLevelCreated(uint32_t change_id, | 315 void OnTopLevelCreated(uint32_t change_id, |
| 313 ui::mojom::WindowDataPtr data, | 316 ui::mojom::WindowDataPtr data, |
| 314 int64_t display_id, | 317 int64_t display_id, |
| 315 bool drawn) override; | 318 bool drawn) override; |
| 316 void OnWindowBoundsChanged(Id window_id, | 319 void OnWindowBoundsChanged(Id window_id, |
| 317 const gfx::Rect& old_bounds, | 320 const gfx::Rect& old_bounds, |
| 318 const gfx::Rect& new_bounds) override; | 321 const gfx::Rect& new_bounds, |
| 322 const cc::LocalFrameId& local_frame_id) override; |
| 319 void OnClientAreaChanged( | 323 void OnClientAreaChanged( |
| 320 uint32_t window_id, | 324 uint32_t window_id, |
| 321 const gfx::Insets& new_client_area, | 325 const gfx::Insets& new_client_area, |
| 322 const std::vector<gfx::Rect>& new_additional_client_areas) override; | 326 const std::vector<gfx::Rect>& new_additional_client_areas) override; |
| 323 void OnTransientWindowAdded(uint32_t window_id, | 327 void OnTransientWindowAdded(uint32_t window_id, |
| 324 uint32_t transient_window_id) override; | 328 uint32_t transient_window_id) override; |
| 325 void OnTransientWindowRemoved(uint32_t window_id, | 329 void OnTransientWindowRemoved(uint32_t window_id, |
| 326 uint32_t transient_window_id) override; | 330 uint32_t transient_window_id) override; |
| 327 void OnWindowHierarchyChanged( | 331 void OnWindowHierarchyChanged( |
| 328 Id window_id, | 332 Id window_id, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 387 |
| 384 // Overridden from WindowManager: | 388 // Overridden from WindowManager: |
| 385 void OnConnect(ClientSpecificId client_id) override; | 389 void OnConnect(ClientSpecificId client_id) override; |
| 386 void WmNewDisplayAdded(const display::Display& display, | 390 void WmNewDisplayAdded(const display::Display& display, |
| 387 ui::mojom::WindowDataPtr root_data, | 391 ui::mojom::WindowDataPtr root_data, |
| 388 bool parent_drawn) override; | 392 bool parent_drawn) override; |
| 389 void WmDisplayRemoved(int64_t display_id) override; | 393 void WmDisplayRemoved(int64_t display_id) override; |
| 390 void WmDisplayModified(const display::Display& display) override; | 394 void WmDisplayModified(const display::Display& display) override; |
| 391 void WmSetBounds(uint32_t change_id, | 395 void WmSetBounds(uint32_t change_id, |
| 392 Id window_id, | 396 Id window_id, |
| 393 const gfx::Rect& transit_bounds_in_pixels) override; | 397 const gfx::Rect& transit_bounds_in_pixels, |
| 398 const cc::LocalFrameId& local_frame_id) override; |
| 394 void WmSetProperty( | 399 void WmSetProperty( |
| 395 uint32_t change_id, | 400 uint32_t change_id, |
| 396 Id window_id, | 401 Id window_id, |
| 397 const std::string& name, | 402 const std::string& name, |
| 398 const base::Optional<std::vector<uint8_t>>& transit_data) override; | 403 const base::Optional<std::vector<uint8_t>>& transit_data) override; |
| 399 void WmCreateTopLevelWindow( | 404 void WmCreateTopLevelWindow( |
| 400 uint32_t change_id, | 405 uint32_t change_id, |
| 401 ClientSpecificId requesting_client_id, | 406 ClientSpecificId requesting_client_id, |
| 402 const std::unordered_map<std::string, std::vector<uint8_t>>& | 407 const std::unordered_map<std::string, std::vector<uint8_t>>& |
| 403 transport_properties) override; | 408 transport_properties) override; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 // The current change id for the client. | 531 // The current change id for the client. |
| 527 uint32_t current_move_loop_change_ = 0u; | 532 uint32_t current_move_loop_change_ = 0u; |
| 528 | 533 |
| 529 // Callback executed when a move loop initiated by PerformWindowMove() is | 534 // Callback executed when a move loop initiated by PerformWindowMove() is |
| 530 // completed. | 535 // completed. |
| 531 base::Callback<void(bool)> on_current_move_finished_; | 536 base::Callback<void(bool)> on_current_move_finished_; |
| 532 | 537 |
| 533 // The current change id for the window manager. | 538 // The current change id for the window manager. |
| 534 uint32_t current_wm_move_loop_change_ = 0u; | 539 uint32_t current_wm_move_loop_change_ = 0u; |
| 535 Id current_wm_move_loop_window_id_ = 0u; | 540 Id current_wm_move_loop_window_id_ = 0u; |
| 541 std::unordered_map<cc::FrameSinkId, |
| 542 std::unique_ptr<cc::SurfaceIdAllocator>, |
| 543 cc::FrameSinkIdHash> |
| 544 local_frame_id_allocators_; |
| 536 | 545 |
| 537 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; | 546 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; |
| 538 | 547 |
| 539 base::ObserverList<WindowTreeClientTestObserver> test_observers_; | 548 base::ObserverList<WindowTreeClientTestObserver> test_observers_; |
| 540 | 549 |
| 541 std::unique_ptr<ui::Gpu> gpu_; | 550 std::unique_ptr<ui::Gpu> gpu_; |
| 542 std::unique_ptr<MusContextFactory> compositor_context_factory_; | 551 std::unique_ptr<MusContextFactory> compositor_context_factory_; |
| 543 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 552 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
| 544 | 553 |
| 545 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 554 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
| 546 }; | 555 }; |
| 547 | 556 |
| 548 } // namespace aura | 557 } // namespace aura |
| 549 | 558 |
| 550 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 559 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |