| 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 12 matching lines...) Expand all Loading... |
| 23 #include "services/ui/public/interfaces/window_tree.mojom.h" | 23 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 24 #include "ui/aura/aura_export.h" | 24 #include "ui/aura/aura_export.h" |
| 25 #include "ui/aura/client/transient_window_client_observer.h" | 25 #include "ui/aura/client/transient_window_client_observer.h" |
| 26 #include "ui/aura/mus/capture_synchronizer_delegate.h" | 26 #include "ui/aura/mus/capture_synchronizer_delegate.h" |
| 27 #include "ui/aura/mus/drag_drop_controller_host.h" | 27 #include "ui/aura/mus/drag_drop_controller_host.h" |
| 28 #include "ui/aura/mus/focus_synchronizer_delegate.h" | 28 #include "ui/aura/mus/focus_synchronizer_delegate.h" |
| 29 #include "ui/aura/mus/mus_types.h" | 29 #include "ui/aura/mus/mus_types.h" |
| 30 #include "ui/aura/mus/window_manager_delegate.h" | 30 #include "ui/aura/mus/window_manager_delegate.h" |
| 31 #include "ui/aura/mus/window_tree_host_mus_delegate.h" | 31 #include "ui/aura/mus/window_tree_host_mus_delegate.h" |
| 32 | 32 |
| 33 namespace base { |
| 34 class Thread; |
| 35 } |
| 36 |
| 37 namespace discardable_memory { |
| 38 class ClientDiscardableSharedMemoryManager; |
| 39 } |
| 40 |
| 33 namespace display { | 41 namespace display { |
| 34 class Display; | 42 class Display; |
| 35 } | 43 } |
| 36 | 44 |
| 37 namespace gfx { | 45 namespace gfx { |
| 38 class Insets; | 46 class Insets; |
| 39 } | 47 } |
| 40 | 48 |
| 41 namespace service_manager { | 49 namespace service_manager { |
| 42 class Connector; | 50 class Connector; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 class AURA_EXPORT WindowTreeClient | 87 class AURA_EXPORT WindowTreeClient |
| 80 : NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient), | 88 : NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient), |
| 81 NON_EXPORTED_BASE(public ui::mojom::WindowManager), | 89 NON_EXPORTED_BASE(public ui::mojom::WindowManager), |
| 82 public CaptureSynchronizerDelegate, | 90 public CaptureSynchronizerDelegate, |
| 83 public FocusSynchronizerDelegate, | 91 public FocusSynchronizerDelegate, |
| 84 public DragDropControllerHost, | 92 public DragDropControllerHost, |
| 85 public WindowManagerClient, | 93 public WindowManagerClient, |
| 86 public WindowTreeHostMusDelegate, | 94 public WindowTreeHostMusDelegate, |
| 87 public client::TransientWindowClientObserver { | 95 public client::TransientWindowClientObserver { |
| 88 public: | 96 public: |
| 89 explicit WindowTreeClient( | 97 // |create_discardable_memory| If it is true, WindowTreeClient will setup the |
| 98 // dicardable shared memory manager for this process. In some test, more than |
| 99 // one WindowTreeClient will be created, so we need pass false to avoid |
| 100 // setup the discardable shared memory manager more than once. |
| 101 WindowTreeClient( |
| 90 service_manager::Connector* connector, | 102 service_manager::Connector* connector, |
| 91 WindowTreeClientDelegate* delegate, | 103 WindowTreeClientDelegate* delegate, |
| 92 WindowManagerDelegate* window_manager_delegate = nullptr, | 104 WindowManagerDelegate* window_manager_delegate = nullptr, |
| 93 ui::mojom::WindowTreeClientRequest request = nullptr, | 105 ui::mojom::WindowTreeClientRequest request = nullptr, |
| 94 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr); | 106 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr, |
| 107 bool create_discardable_memory = true); |
| 95 ~WindowTreeClient() override; | 108 ~WindowTreeClient() override; |
| 96 | 109 |
| 97 // Establishes the connection by way of the WindowTreeFactory. | 110 // Establishes the connection by way of the WindowTreeFactory. |
| 98 void ConnectViaWindowTreeFactory(); | 111 void ConnectViaWindowTreeFactory(); |
| 99 | 112 |
| 100 // Establishes the connection by way of WindowManagerWindowTreeFactory. | 113 // Establishes the connection by way of WindowManagerWindowTreeFactory. |
| 101 void ConnectAsWindowManager(); | 114 void ConnectAsWindowManager(); |
| 102 | 115 |
| 103 service_manager::Connector* connector() { return connector_; } | 116 service_manager::Connector* connector() { return connector_; } |
| 104 ui::Gpu* gpu() { return gpu_.get(); } | 117 ui::Gpu* gpu() { return gpu_.get(); } |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 base::Callback<void(bool)> on_current_move_finished_; | 549 base::Callback<void(bool)> on_current_move_finished_; |
| 537 | 550 |
| 538 // The current change id for the window manager. | 551 // The current change id for the window manager. |
| 539 uint32_t current_wm_move_loop_change_ = 0u; | 552 uint32_t current_wm_move_loop_change_ = 0u; |
| 540 Id current_wm_move_loop_window_id_ = 0u; | 553 Id current_wm_move_loop_window_id_ = 0u; |
| 541 | 554 |
| 542 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; | 555 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; |
| 543 | 556 |
| 544 base::ObserverList<WindowTreeClientTestObserver> test_observers_; | 557 base::ObserverList<WindowTreeClientTestObserver> test_observers_; |
| 545 | 558 |
| 559 // IO thread for GPU and discardable shared memory IPC. |
| 560 std::unique_ptr<base::Thread> io_thread_; |
| 561 |
| 546 std::unique_ptr<ui::Gpu> gpu_; | 562 std::unique_ptr<ui::Gpu> gpu_; |
| 547 std::unique_ptr<MusContextFactory> compositor_context_factory_; | 563 std::unique_ptr<MusContextFactory> compositor_context_factory_; |
| 548 | 564 |
| 565 std::unique_ptr<discardable_memory::ClientDiscardableSharedMemoryManager> |
| 566 discardable_shared_memory_manager_; |
| 567 |
| 549 // If |compositor_context_factory_| is installed on Env, then this is the | 568 // If |compositor_context_factory_| is installed on Env, then this is the |
| 550 // ContextFactory that was set on Env originally. | 569 // ContextFactory that was set on Env originally. |
| 551 ui::ContextFactory* initial_context_factory_ = nullptr; | 570 ui::ContextFactory* initial_context_factory_ = nullptr; |
| 552 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 571 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
| 553 | 572 |
| 554 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 573 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
| 555 }; | 574 }; |
| 556 | 575 |
| 557 } // namespace aura | 576 } // namespace aura |
| 558 | 577 |
| 559 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 578 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |