| 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/wallpaper.mojom.h" | 13 #include "ash/public/interfaces/wallpaper.mojom.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "mash/session/public/interfaces/session.mojom.h" | |
| 17 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
| 18 #include "services/service_manager/public/cpp/service.h" | 17 #include "services/service_manager/public/cpp/service.h" |
| 19 #include "services/tracing/public/cpp/provider.h" | 18 #include "services/tracing/public/cpp/provider.h" |
| 20 #include "services/ui/common/types.h" | 19 #include "services/ui/common/types.h" |
| 21 | 20 |
| 22 namespace aura { | 21 namespace aura { |
| 23 class MusContextFactory; | 22 class MusContextFactory; |
| 24 class WindowTreeClient; | 23 class WindowTreeClient; |
| 25 } | 24 } |
| 26 | 25 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 42 class Gpu; | 41 class Gpu; |
| 43 } | 42 } |
| 44 | 43 |
| 45 namespace ash { | 44 namespace ash { |
| 46 namespace mus { | 45 namespace mus { |
| 47 | 46 |
| 48 class NetworkConnectDelegateMus; | 47 class NetworkConnectDelegateMus; |
| 49 class WindowManager; | 48 class WindowManager; |
| 50 | 49 |
| 51 // Hosts the window manager and the ash system user interface for mash. | 50 // Hosts the window manager and the ash system user interface for mash. |
| 52 class WindowManagerApplication | 51 class WindowManagerApplication : public service_manager::Service { |
| 53 : public service_manager::Service, | |
| 54 public mash::session::mojom::ScreenlockStateListener { | |
| 55 public: | 52 public: |
| 56 WindowManagerApplication(); | 53 WindowManagerApplication(); |
| 57 ~WindowManagerApplication() override; | 54 ~WindowManagerApplication() override; |
| 58 | 55 |
| 59 WindowManager* window_manager() { return window_manager_.get(); } | 56 WindowManager* window_manager() { return window_manager_.get(); } |
| 60 | 57 |
| 61 mash::session::mojom::Session* session() { return session_.get(); } | |
| 62 | |
| 63 private: | 58 private: |
| 64 friend class WmTestBase; | 59 friend class WmTestBase; |
| 65 friend class WmTestHelper; | 60 friend class WmTestHelper; |
| 66 | 61 |
| 67 void InitWindowManager( | 62 void InitWindowManager( |
| 68 std::unique_ptr<aura::WindowTreeClient> window_tree_client, | 63 std::unique_ptr<aura::WindowTreeClient> window_tree_client, |
| 69 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool); | 64 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool); |
| 70 | 65 |
| 71 // Initializes lower-level OS-specific components (e.g. D-Bus services). | 66 // Initializes lower-level OS-specific components (e.g. D-Bus services). |
| 72 void InitializeComponents(); | 67 void InitializeComponents(); |
| 73 void ShutdownComponents(); | 68 void ShutdownComponents(); |
| 74 | 69 |
| 75 // service_manager::Service: | 70 // service_manager::Service: |
| 76 void OnStart() override; | 71 void OnStart() override; |
| 77 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 72 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| 78 service_manager::InterfaceRegistry* registry) override; | 73 service_manager::InterfaceRegistry* registry) override; |
| 79 | 74 |
| 80 // session::mojom::ScreenlockStateListener: | |
| 81 void ScreenlockStateChanged(bool locked) override; | |
| 82 | |
| 83 tracing::Provider tracing_; | 75 tracing::Provider tracing_; |
| 84 | 76 |
| 85 std::unique_ptr<views::AuraInit> aura_init_; | 77 std::unique_ptr<views::AuraInit> aura_init_; |
| 86 | 78 |
| 87 std::unique_ptr<ui::Gpu> gpu_; | 79 std::unique_ptr<ui::Gpu> gpu_; |
| 88 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_; | 80 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_; |
| 89 std::unique_ptr<WindowManager> window_manager_; | 81 std::unique_ptr<WindowManager> window_manager_; |
| 90 | 82 |
| 91 // A blocking pool used by the WindowManager's shell; not used in tests. | 83 // A blocking pool used by the WindowManager's shell; not used in tests. |
| 92 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 84 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
| 93 | 85 |
| 94 mash::session::mojom::SessionPtr session_; | |
| 95 | |
| 96 mojo::Binding<mash::session::mojom::ScreenlockStateListener> | |
| 97 screenlock_state_listener_binding_; | |
| 98 | |
| 99 #if defined(OS_CHROMEOS) | 86 #if defined(OS_CHROMEOS) |
| 100 std::unique_ptr<NetworkConnectDelegateMus> network_connect_delegate_; | 87 std::unique_ptr<NetworkConnectDelegateMus> network_connect_delegate_; |
| 101 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> | 88 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> |
| 102 statistics_provider_; | 89 statistics_provider_; |
| 103 #endif | 90 #endif |
| 104 | 91 |
| 105 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); | 92 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); |
| 106 }; | 93 }; |
| 107 | 94 |
| 108 } // namespace mus | 95 } // namespace mus |
| 109 } // namespace ash | 96 } // namespace ash |
| 110 | 97 |
| 111 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ | 98 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ |
| OLD | NEW |