| 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/local_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" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 bool parent_drawn, | 269 bool parent_drawn, |
| 269 const cc::FrameSinkId& frame_sink_id); | 270 const cc::FrameSinkId& frame_sink_id); |
| 270 | 271 |
| 271 std::unique_ptr<EventResultCallback> CreateEventResultCallback( | 272 std::unique_ptr<EventResultCallback> CreateEventResultCallback( |
| 272 int32_t event_id); | 273 int32_t event_id); |
| 273 | 274 |
| 274 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); | 275 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle); |
| 275 | 276 |
| 276 // Called when a property needs to change as the result of a change in the | 277 // Called when a property needs to change as the result of a change in the |
| 277 // server, or the server failing to accept a change. | 278 // server, or the server failing to accept a change. |
| 278 void SetWindowBoundsFromServer(WindowMus* window, | 279 void SetWindowBoundsFromServer( |
| 279 const gfx::Rect& revert_bounds_in_pixels); | 280 WindowMus* window, |
| 281 const gfx::Rect& revert_bounds_in_pixels, |
| 282 const base::Optional<cc::LocalSurfaceId>& local_surface_id); |
| 280 void SetWindowVisibleFromServer(WindowMus* window, bool visible); | 283 void SetWindowVisibleFromServer(WindowMus* window, bool visible); |
| 281 | 284 |
| 282 // Called from OnWindowMusBoundsChanged() and SetRootWindowBounds(). | 285 // Called from OnWindowMusBoundsChanged() and SetRootWindowBounds(). |
| 283 void ScheduleInFlightBoundsChange(WindowMus* window, | 286 void ScheduleInFlightBoundsChange(WindowMus* window, |
| 284 const gfx::Rect& old_bounds, | 287 const gfx::Rect& old_bounds, |
| 285 const gfx::Rect& new_bounds); | 288 const gfx::Rect& new_bounds); |
| 286 | 289 |
| 287 // Following are called from WindowMus. | 290 // Following are called from WindowMus. |
| 288 void OnWindowMusCreated(WindowMus* window); | 291 void OnWindowMusCreated(WindowMus* window); |
| 289 void OnWindowMusDestroyed(WindowMus* window, Origin origin); | 292 void OnWindowMusDestroyed(WindowMus* window, Origin origin); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 void OnDragLeave(Id window_id) override; | 389 void OnDragLeave(Id window_id) override; |
| 387 void OnCompleteDrop(Id window_id, | 390 void OnCompleteDrop(Id window_id, |
| 388 uint32_t event_flags, | 391 uint32_t event_flags, |
| 389 const gfx::Point& position, | 392 const gfx::Point& position, |
| 390 uint32_t effect_bitmask, | 393 uint32_t effect_bitmask, |
| 391 const OnCompleteDropCallback& callback) override; | 394 const OnCompleteDropCallback& callback) override; |
| 392 void OnPerformDragDropCompleted(uint32_t window, | 395 void OnPerformDragDropCompleted(uint32_t window, |
| 393 bool success, | 396 bool success, |
| 394 uint32_t action_taken) override; | 397 uint32_t action_taken) override; |
| 395 void OnDragDropDone() override; | 398 void OnDragDropDone() override; |
| 399 void OnSetWindowBoundsResponse( |
| 400 uint32_t change_id, |
| 401 const gfx::Rect& bounds, |
| 402 const cc::LocalSurfaceId& local_surface_id) override; |
| 396 void OnChangeCompleted(uint32_t change_id, bool success) override; | 403 void OnChangeCompleted(uint32_t change_id, bool success) override; |
| 397 void RequestClose(uint32_t window_id) override; | 404 void RequestClose(uint32_t window_id) override; |
| 398 void GetWindowManager( | 405 void GetWindowManager( |
| 399 mojo::AssociatedInterfaceRequest<WindowManager> internal) override; | 406 mojo::AssociatedInterfaceRequest<WindowManager> internal) override; |
| 400 | 407 |
| 401 // Overridden from WindowManager: | 408 // Overridden from WindowManager: |
| 402 void OnConnect(ClientSpecificId client_id) override; | 409 void OnConnect(ClientSpecificId client_id) override; |
| 403 void WmNewDisplayAdded(const display::Display& display, | 410 void WmNewDisplayAdded(const display::Display& display, |
| 404 ui::mojom::WindowDataPtr root_data, | 411 ui::mojom::WindowDataPtr root_data, |
| 405 bool parent_drawn, | 412 bool parent_drawn, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 ui::mojom::WindowTreePtr tree_ptr_; | 540 ui::mojom::WindowTreePtr tree_ptr_; |
| 534 // Typically this is the value contained in |tree_ptr_|, but tests may | 541 // Typically this is the value contained in |tree_ptr_|, but tests may |
| 535 // directly set this. | 542 // directly set this. |
| 536 ui::mojom::WindowTree* tree_; | 543 ui::mojom::WindowTree* tree_; |
| 537 | 544 |
| 538 // Set to true if OnEmbed() was received. | 545 // Set to true if OnEmbed() was received. |
| 539 bool is_from_embed_ = false; | 546 bool is_from_embed_ = false; |
| 540 | 547 |
| 541 bool in_destructor_; | 548 bool in_destructor_; |
| 542 | 549 |
| 550 bool enable_surface_synchronization_ = false; |
| 551 |
| 543 // A mapping to shared memory that is one 32 bit integer long. The window | 552 // A mapping to shared memory that is one 32 bit integer long. The window |
| 544 // server uses this to let us synchronously read the cursor location. | 553 // server uses this to let us synchronously read the cursor location. |
| 545 mojo::ScopedSharedBufferMapping cursor_location_mapping_; | 554 mojo::ScopedSharedBufferMapping cursor_location_mapping_; |
| 546 | 555 |
| 547 base::ObserverList<WindowTreeClientObserver> observers_; | 556 base::ObserverList<WindowTreeClientObserver> observers_; |
| 548 | 557 |
| 549 std::unique_ptr<mojo::AssociatedBinding<ui::mojom::WindowManager>> | 558 std::unique_ptr<mojo::AssociatedBinding<ui::mojom::WindowManager>> |
| 550 window_manager_internal_; | 559 window_manager_internal_; |
| 551 ui::mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_; | 560 ui::mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_; |
| 552 | 561 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 580 // ContextFactory that was set on Env originally. | 589 // ContextFactory that was set on Env originally. |
| 581 ui::ContextFactory* initial_context_factory_ = nullptr; | 590 ui::ContextFactory* initial_context_factory_ = nullptr; |
| 582 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 591 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
| 583 | 592 |
| 584 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 593 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
| 585 }; | 594 }; |
| 586 | 595 |
| 587 } // namespace aura | 596 } // namespace aura |
| 588 | 597 |
| 589 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 598 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |