Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: ash/mus/window_manager_application.h

Issue 2413503002: Cleanup mojo Wallpaper interfaces for mash. (Closed)
Patch Set: Sync and rebase again... Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/mus/wallpaper_delegate_mus.cc ('k') | ash/mus/window_manager_application.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 16 #include "mash/session/public/interfaces/session.mojom.h"
17 #include "mojo/public/cpp/bindings/binding.h" 17 #include "mojo/public/cpp/bindings/binding.h"
18 #include "mojo/public/cpp/bindings/binding_set.h"
19 #include "services/service_manager/public/cpp/service.h" 18 #include "services/service_manager/public/cpp/service.h"
20 #include "services/tracing/public/cpp/provider.h" 19 #include "services/tracing/public/cpp/provider.h"
21 #include "services/ui/common/types.h" 20 #include "services/ui/common/types.h"
22 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" 21 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h"
23 22
24 namespace base { 23 namespace base {
25 class SequencedWorkerPool; 24 class SequencedWorkerPool;
26 } 25 }
27 26
28 namespace chromeos { 27 namespace chromeos {
(...skipping 17 matching lines...) Expand all
46 namespace mus { 45 namespace mus {
47 46
48 class AcceleratorRegistrarImpl; 47 class AcceleratorRegistrarImpl;
49 class NativeWidgetFactoryMus; 48 class NativeWidgetFactoryMus;
50 class NetworkConnectDelegateMus; 49 class NetworkConnectDelegateMus;
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 service_manager::Service, 54 : public service_manager::Service,
56 public service_manager::InterfaceFactory<mojom::WallpaperController>,
57 public service_manager::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, 55 public service_manager::InterfaceFactory<ui::mojom::AcceleratorRegistrar>,
58 public mash::session::mojom::ScreenlockStateListener { 56 public mash::session::mojom::ScreenlockStateListener {
59 public: 57 public:
60 WindowManagerApplication(); 58 WindowManagerApplication();
61 ~WindowManagerApplication() override; 59 ~WindowManagerApplication() override;
62 60
63 WindowManager* window_manager() { return window_manager_.get(); } 61 WindowManager* window_manager() { return window_manager_.get(); }
64 62
65 mash::session::mojom::Session* session() { return session_.get(); } 63 mash::session::mojom::Session* session() { return session_.get(); }
66 64
67 private: 65 private:
68 friend class WmTestBase; 66 friend class WmTestBase;
69 friend class WmTestHelper; 67 friend class WmTestHelper;
70 68
71 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar); 69 void OnAcceleratorRegistrarDestroyed(AcceleratorRegistrarImpl* registrar);
72 70
73 void InitWindowManager( 71 void InitWindowManager(
74 std::unique_ptr<ui::WindowTreeClient> window_tree_client, 72 std::unique_ptr<ui::WindowTreeClient> window_tree_client,
75 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool); 73 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool);
76 74
77 // Initializes lower-level OS-specific components (e.g. D-Bus services). 75 // Initializes lower-level OS-specific components (e.g. D-Bus services).
78 void InitializeComponents(); 76 void InitializeComponents();
79 void ShutdownComponents(); 77 void ShutdownComponents();
80 78
81 // service_manager::Service: 79 // service_manager::Service:
82 void OnStart(const service_manager::Identity& identity) override; 80 void OnStart(const service_manager::Identity& identity) override;
83 bool OnConnect(const service_manager::Identity& remote_identity, 81 bool OnConnect(const service_manager::Identity& remote_identity,
84 service_manager::InterfaceRegistry* registry) override; 82 service_manager::InterfaceRegistry* registry) override;
85 83
86 // InterfaceFactory<mojom::WallpaperController>:
87 void Create(const service_manager::Identity& remote_identity,
88 mojom::WallpaperControllerRequest request) override;
89
90 // service_manager::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: 84 // service_manager::InterfaceFactory<ui::mojom::AcceleratorRegistrar>:
91 void Create(const service_manager::Identity& remote_identity, 85 void Create(const service_manager::Identity& remote_identity,
92 ui::mojom::AcceleratorRegistrarRequest request) override; 86 ui::mojom::AcceleratorRegistrarRequest request) override;
93 87
94 // session::mojom::ScreenlockStateListener: 88 // session::mojom::ScreenlockStateListener:
95 void ScreenlockStateChanged(bool locked) override; 89 void ScreenlockStateChanged(bool locked) override;
96 90
97 tracing::Provider tracing_; 91 tracing::Provider tracing_;
98 92
99 std::unique_ptr<views::AuraInit> aura_init_; 93 std::unique_ptr<views::AuraInit> aura_init_;
100 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; 94 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_;
101 95
102 std::unique_ptr<ui::GpuService> gpu_service_; 96 std::unique_ptr<ui::GpuService> gpu_service_;
103 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; 97 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_;
104 std::unique_ptr<WindowManager> window_manager_; 98 std::unique_ptr<WindowManager> window_manager_;
105 99
106 // A blocking pool used by the WindowManager's shell; not used in tests. 100 // A blocking pool used by the WindowManager's shell; not used in tests.
107 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; 101 scoped_refptr<base::SequencedWorkerPool> blocking_pool_;
108 102
109 mojo::BindingSet<mojom::WallpaperController> wallpaper_controller_bindings_;
110
111 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; 103 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_;
112 104
113 mash::session::mojom::SessionPtr session_; 105 mash::session::mojom::SessionPtr session_;
114 106
115 mojo::Binding<mash::session::mojom::ScreenlockStateListener> 107 mojo::Binding<mash::session::mojom::ScreenlockStateListener>
116 screenlock_state_listener_binding_; 108 screenlock_state_listener_binding_;
117 109
118 #if defined(OS_CHROMEOS) 110 #if defined(OS_CHROMEOS)
119 std::unique_ptr<NetworkConnectDelegateMus> network_connect_delegate_; 111 std::unique_ptr<NetworkConnectDelegateMus> network_connect_delegate_;
120 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> 112 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider>
121 statistics_provider_; 113 statistics_provider_;
122 #endif 114 #endif
123 115
124 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); 116 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication);
125 }; 117 };
126 118
127 } // namespace mus 119 } // namespace mus
128 } // namespace ash 120 } // namespace ash
129 121
130 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ 122 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_
OLDNEW
« no previous file with comments | « ash/mus/wallpaper_delegate_mus.cc ('k') | ash/mus/window_manager_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698