| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 5 #ifndef ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
| 6 #define ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 6 #define ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 | 12 |
| 13 #include "ash/public/interfaces/shelf.mojom.h" | 13 #include "ash/public/interfaces/shelf.mojom.h" |
| 14 #include "ash/public/interfaces/wallpaper.mojom.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "mash/session/public/interfaces/session.mojom.h" | 17 #include "mash/session/public/interfaces/session.mojom.h" |
| 17 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.h" |
| 18 #include "mojo/public/cpp/bindings/binding_set.h" | 19 #include "mojo/public/cpp/bindings/binding_set.h" |
| 19 #include "services/shell/public/cpp/service.h" | 20 #include "services/shell/public/cpp/service.h" |
| 20 #include "services/tracing/public/cpp/provider.h" | 21 #include "services/tracing/public/cpp/provider.h" |
| 21 #include "services/ui/common/types.h" | 22 #include "services/ui/common/types.h" |
| 22 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" | 23 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" |
| 23 | 24 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 } | 44 } |
| 44 | 45 |
| 45 namespace ash { | 46 namespace ash { |
| 46 namespace mus { | 47 namespace mus { |
| 47 | 48 |
| 48 class AcceleratorRegistrarImpl; | 49 class AcceleratorRegistrarImpl; |
| 49 class NativeWidgetFactoryMus; | 50 class NativeWidgetFactoryMus; |
| 50 class WindowManager; | 51 class WindowManager; |
| 51 | 52 |
| 52 // Hosts the window manager and the ash system user interface for mash. | 53 // Hosts the window manager and the ash system user interface for mash. |
| 53 // TODO(mash): Port ash_sysui's WallpaperController here. | |
| 54 class WindowManagerApplication | 54 class WindowManagerApplication |
| 55 : public shell::Service, | 55 : public shell::Service, |
| 56 public shell::InterfaceFactory<ash::mojom::ShelfController>, | 56 public shell::InterfaceFactory<ash::mojom::ShelfController>, |
| 57 public shell::InterfaceFactory<ash::mojom::WallpaperController>, |
| 57 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, | 58 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, |
| 58 public mash::session::mojom::ScreenlockStateListener { | 59 public mash::session::mojom::ScreenlockStateListener { |
| 59 public: | 60 public: |
| 60 WindowManagerApplication(); | 61 WindowManagerApplication(); |
| 61 ~WindowManagerApplication() override; | 62 ~WindowManagerApplication() override; |
| 62 | 63 |
| 63 WindowManager* window_manager() { return window_manager_.get(); } | 64 WindowManager* window_manager() { return window_manager_.get(); } |
| 64 | 65 |
| 65 mash::session::mojom::Session* session() { return session_.get(); } | 66 mash::session::mojom::Session* session() { return session_.get(); } |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 friend class WmTestBase; | 69 friend class WmTestBase; |
| 69 friend class WmTestHelper; | 70 friend class WmTestHelper; |
| 70 | 71 |
| 71 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); | 72 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); |
| 72 | 73 |
| 73 void InitWindowManager( | 74 void InitWindowManager( |
| 74 std::unique_ptr<ui::WindowTreeClient> window_tree_client, | 75 std::unique_ptr<ui::WindowTreeClient> window_tree_client, |
| 75 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool); | 76 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool); |
| 76 | 77 |
| 77 // shell::Service: | 78 // shell::Service: |
| 78 void OnStart(const shell::Identity& identity) override; | 79 void OnStart(const shell::Identity& identity) override; |
| 79 bool OnConnect(const shell::Identity& remote_identity, | 80 bool OnConnect(const shell::Identity& remote_identity, |
| 80 shell::InterfaceRegistry* registry) override; | 81 shell::InterfaceRegistry* registry) override; |
| 81 | 82 |
| 82 // InterfaceFactory<ash::mojom::ShelfController>: | 83 // InterfaceFactory<ash::mojom::ShelfController>: |
| 83 void Create(const shell::Identity& remote_identity, | 84 void Create(const shell::Identity& remote_identity, |
| 84 ash::mojom::ShelfControllerRequest request) override; | 85 ash::mojom::ShelfControllerRequest request) override; |
| 85 | 86 |
| 87 // InterfaceFactory<ash::mojom::WallpaperController>: |
| 88 void Create(const shell::Identity& remote_identity, |
| 89 ash::mojom::WallpaperControllerRequest request) override; |
| 90 |
| 86 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: | 91 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: |
| 87 void Create(const shell::Identity& remote_identity, | 92 void Create(const shell::Identity& remote_identity, |
| 88 ui::mojom::AcceleratorRegistrarRequest request) override; | 93 ui::mojom::AcceleratorRegistrarRequest request) override; |
| 89 | 94 |
| 90 // session::mojom::ScreenlockStateListener: | 95 // session::mojom::ScreenlockStateListener: |
| 91 void ScreenlockStateChanged(bool locked) override; | 96 void ScreenlockStateChanged(bool locked) override; |
| 92 | 97 |
| 93 tracing::Provider tracing_; | 98 tracing::Provider tracing_; |
| 94 | 99 |
| 95 std::unique_ptr<views::AuraInit> aura_init_; | 100 std::unique_ptr<views::AuraInit> aura_init_; |
| 96 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; | 101 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; |
| 97 | 102 |
| 98 std::unique_ptr<ui::GpuService> gpu_service_; | 103 std::unique_ptr<ui::GpuService> gpu_service_; |
| 99 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; | 104 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; |
| 100 std::unique_ptr<WindowManager> window_manager_; | 105 std::unique_ptr<WindowManager> window_manager_; |
| 101 | 106 |
| 102 // A blocking pool used by the WindowManager's shell; not used in tests. | 107 // A blocking pool used by the WindowManager's shell; not used in tests. |
| 103 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 108 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
| 104 | 109 |
| 105 mojo::BindingSet<ash::mojom::ShelfController> shelf_controller_bindings_; | 110 mojo::BindingSet<ash::mojom::ShelfController> shelf_controller_bindings_; |
| 111 mojo::BindingSet<ash::mojom::WallpaperController> |
| 112 wallpaper_controller_bindings_; |
| 106 | 113 |
| 107 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; | 114 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; |
| 108 | 115 |
| 109 mash::session::mojom::SessionPtr session_; | 116 mash::session::mojom::SessionPtr session_; |
| 110 | 117 |
| 111 mojo::Binding<mash::session::mojom::ScreenlockStateListener> | 118 mojo::Binding<mash::session::mojom::ScreenlockStateListener> |
| 112 screenlock_state_listener_binding_; | 119 screenlock_state_listener_binding_; |
| 113 | 120 |
| 114 #if defined(OS_CHROMEOS) | 121 #if defined(OS_CHROMEOS) |
| 115 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> | 122 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> |
| 116 statistics_provider_; | 123 statistics_provider_; |
| 117 #endif | 124 #endif |
| 118 | 125 |
| 119 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 126 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
| 120 }; | 127 }; |
| 121 | 128 |
| 122 } // namespace mus | 129 } // namespace mus |
| 123 } // namespace ash | 130 } // namespace ash |
| 124 | 131 |
| 125 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 132 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
| OLD | NEW |