| 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" | |
| 14 #include "ash/public/interfaces/wallpaper.mojom.h" | 13 #include "ash/public/interfaces/wallpaper.mojom.h" |
| 15 #include "base/macros.h" | 14 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 17 #include "mash/session/public/interfaces/session.mojom.h" | 16 #include "mash/session/public/interfaces/session.mojom.h" |
| 18 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
| 19 #include "mojo/public/cpp/bindings/binding_set.h" | 18 #include "mojo/public/cpp/bindings/binding_set.h" |
| 20 #include "services/shell/public/cpp/service.h" | 19 #include "services/shell/public/cpp/service.h" |
| 21 #include "services/tracing/public/cpp/provider.h" | 20 #include "services/tracing/public/cpp/provider.h" |
| 22 #include "services/ui/common/types.h" | 21 #include "services/ui/common/types.h" |
| 23 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" | 22 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 namespace ash { | 45 namespace ash { |
| 47 namespace mus { | 46 namespace mus { |
| 48 | 47 |
| 49 class AcceleratorRegistrarImpl; | 48 class AcceleratorRegistrarImpl; |
| 50 class NativeWidgetFactoryMus; | 49 class NativeWidgetFactoryMus; |
| 51 class WindowManager; | 50 class WindowManager; |
| 52 | 51 |
| 53 // Hosts the window manager and the ash system user interface for mash. | 52 // Hosts the window manager and the ash system user interface for mash. |
| 54 class WindowManagerApplication | 53 class WindowManagerApplication |
| 55 : public shell::Service, | 54 : public shell::Service, |
| 56 public shell::InterfaceFactory<mojom::ShelfController>, | |
| 57 public shell::InterfaceFactory<mojom::WallpaperController>, | 55 public shell::InterfaceFactory<mojom::WallpaperController>, |
| 58 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, | 56 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, |
| 59 public mash::session::mojom::ScreenlockStateListener { | 57 public mash::session::mojom::ScreenlockStateListener { |
| 60 public: | 58 public: |
| 61 WindowManagerApplication(); | 59 WindowManagerApplication(); |
| 62 ~WindowManagerApplication() override; | 60 ~WindowManagerApplication() override; |
| 63 | 61 |
| 64 WindowManager* window_manager() { return window_manager_.get(); } | 62 WindowManager* window_manager() { return window_manager_.get(); } |
| 65 | 63 |
| 66 mash::session::mojom::Session* session() { return session_.get(); } | 64 mash::session::mojom::Session* session() { return session_.get(); } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 77 | 75 |
| 78 // Initializes lower-level OS-specific components (e.g. D-Bus services). | 76 // Initializes lower-level OS-specific components (e.g. D-Bus services). |
| 79 void InitializeComponents(); | 77 void InitializeComponents(); |
| 80 void ShutdownComponents(); | 78 void ShutdownComponents(); |
| 81 | 79 |
| 82 // shell::Service: | 80 // shell::Service: |
| 83 void OnStart(const shell::Identity& identity) override; | 81 void OnStart(const shell::Identity& identity) override; |
| 84 bool OnConnect(const shell::Identity& remote_identity, | 82 bool OnConnect(const shell::Identity& remote_identity, |
| 85 shell::InterfaceRegistry* registry) override; | 83 shell::InterfaceRegistry* registry) override; |
| 86 | 84 |
| 87 // InterfaceFactory<mojom::ShelfController>: | |
| 88 void Create(const shell::Identity& remote_identity, | |
| 89 mojom::ShelfControllerRequest request) override; | |
| 90 | |
| 91 // InterfaceFactory<mojom::WallpaperController>: | 85 // InterfaceFactory<mojom::WallpaperController>: |
| 92 void Create(const shell::Identity& remote_identity, | 86 void Create(const shell::Identity& remote_identity, |
| 93 mojom::WallpaperControllerRequest request) override; | 87 mojom::WallpaperControllerRequest request) override; |
| 94 | 88 |
| 95 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: | 89 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: |
| 96 void Create(const shell::Identity& remote_identity, | 90 void Create(const shell::Identity& remote_identity, |
| 97 ui::mojom::AcceleratorRegistrarRequest request) override; | 91 ui::mojom::AcceleratorRegistrarRequest request) override; |
| 98 | 92 |
| 99 // session::mojom::ScreenlockStateListener: | 93 // session::mojom::ScreenlockStateListener: |
| 100 void ScreenlockStateChanged(bool locked) override; | 94 void ScreenlockStateChanged(bool locked) override; |
| 101 | 95 |
| 102 tracing::Provider tracing_; | 96 tracing::Provider tracing_; |
| 103 | 97 |
| 104 std::unique_ptr<views::AuraInit> aura_init_; | 98 std::unique_ptr<views::AuraInit> aura_init_; |
| 105 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; | 99 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; |
| 106 | 100 |
| 107 std::unique_ptr<ui::GpuService> gpu_service_; | 101 std::unique_ptr<ui::GpuService> gpu_service_; |
| 108 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; | 102 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; |
| 109 std::unique_ptr<WindowManager> window_manager_; | 103 std::unique_ptr<WindowManager> window_manager_; |
| 110 | 104 |
| 111 // A blocking pool used by the WindowManager's shell; not used in tests. | 105 // A blocking pool used by the WindowManager's shell; not used in tests. |
| 112 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 106 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
| 113 | 107 |
| 114 mojo::BindingSet<mojom::ShelfController> shelf_controller_bindings_; | |
| 115 mojo::BindingSet<mojom::WallpaperController> wallpaper_controller_bindings_; | 108 mojo::BindingSet<mojom::WallpaperController> wallpaper_controller_bindings_; |
| 116 | 109 |
| 117 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; | 110 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; |
| 118 | 111 |
| 119 mash::session::mojom::SessionPtr session_; | 112 mash::session::mojom::SessionPtr session_; |
| 120 | 113 |
| 121 mojo::Binding<mash::session::mojom::ScreenlockStateListener> | 114 mojo::Binding<mash::session::mojom::ScreenlockStateListener> |
| 122 screenlock_state_listener_binding_; | 115 screenlock_state_listener_binding_; |
| 123 | 116 |
| 124 #if defined(OS_CHROMEOS) | 117 #if defined(OS_CHROMEOS) |
| 125 class StubNetworkConnectDelegate; | 118 class StubNetworkConnectDelegate; |
| 126 std::unique_ptr<StubNetworkConnectDelegate> network_connect_delegate_; | 119 std::unique_ptr<StubNetworkConnectDelegate> network_connect_delegate_; |
| 127 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> | 120 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> |
| 128 statistics_provider_; | 121 statistics_provider_; |
| 129 #endif | 122 #endif |
| 130 | 123 |
| 131 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 124 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
| 132 }; | 125 }; |
| 133 | 126 |
| 134 } // namespace mus | 127 } // namespace mus |
| 135 } // namespace ash | 128 } // namespace ash |
| 136 | 129 |
| 137 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 130 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
| OLD | NEW |