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

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

Issue 2381753002: Use mojo SystemTray interfaces for both mash and classic ash (Closed)
Patch Set: Restructure based on feedback 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
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/shelf.mojom.h" 13 #include "ash/public/interfaces/shelf.mojom.h"
14 #include "ash/public/interfaces/system_tray.mojom.h"
15 #include "ash/public/interfaces/wallpaper.mojom.h" 14 #include "ash/public/interfaces/wallpaper.mojom.h"
16 #include "base/macros.h" 15 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
18 #include "mash/session/public/interfaces/session.mojom.h" 17 #include "mash/session/public/interfaces/session.mojom.h"
19 #include "mojo/public/cpp/bindings/binding.h" 18 #include "mojo/public/cpp/bindings/binding.h"
20 #include "mojo/public/cpp/bindings/binding_set.h" 19 #include "mojo/public/cpp/bindings/binding_set.h"
21 #include "services/shell/public/cpp/service.h" 20 #include "services/shell/public/cpp/service.h"
22 #include "services/tracing/public/cpp/provider.h" 21 #include "services/tracing/public/cpp/provider.h"
23 #include "services/ui/common/types.h" 22 #include "services/ui/common/types.h"
24 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h" 23 #include "services/ui/public/interfaces/accelerator_registrar.mojom.h"
(...skipping 23 matching lines...) Expand all
48 namespace mus { 47 namespace mus {
49 48
50 class AcceleratorRegistrarImpl; 49 class AcceleratorRegistrarImpl;
51 class NativeWidgetFactoryMus; 50 class NativeWidgetFactoryMus;
52 class WindowManager; 51 class WindowManager;
53 52
54 // 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.
55 class WindowManagerApplication 54 class WindowManagerApplication
56 : public shell::Service, 55 : public shell::Service,
57 public shell::InterfaceFactory<mojom::ShelfController>, 56 public shell::InterfaceFactory<mojom::ShelfController>,
58 public shell::InterfaceFactory<mojom::SystemTray>,
59 public shell::InterfaceFactory<mojom::WallpaperController>, 57 public shell::InterfaceFactory<mojom::WallpaperController>,
60 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>, 58 public shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>,
61 public mash::session::mojom::ScreenlockStateListener { 59 public mash::session::mojom::ScreenlockStateListener {
62 public: 60 public:
63 WindowManagerApplication(); 61 WindowManagerApplication();
64 ~WindowManagerApplication() override; 62 ~WindowManagerApplication() override;
65 63
66 WindowManager* window_manager() { return window_manager_.get(); } 64 WindowManager* window_manager() { return window_manager_.get(); }
67 65
68 mash::session::mojom::Session* session() { return session_.get(); } 66 mash::session::mojom::Session* session() { return session_.get(); }
(...skipping 10 matching lines...) Expand all
79 77
80 // shell::Service: 78 // shell::Service:
81 void OnStart(const shell::Identity& identity) override; 79 void OnStart(const shell::Identity& identity) override;
82 bool OnConnect(const shell::Identity& remote_identity, 80 bool OnConnect(const shell::Identity& remote_identity,
83 shell::InterfaceRegistry* registry) override; 81 shell::InterfaceRegistry* registry) override;
84 82
85 // InterfaceFactory<mojom::ShelfController>: 83 // InterfaceFactory<mojom::ShelfController>:
86 void Create(const shell::Identity& remote_identity, 84 void Create(const shell::Identity& remote_identity,
87 mojom::ShelfControllerRequest request) override; 85 mojom::ShelfControllerRequest request) override;
88 86
89 // InterfaceFactory<mojom::SystemTray>:
90 void Create(const shell::Identity& remote_identity,
91 mojom::SystemTrayRequest request) override;
92
93 // InterfaceFactory<mojom::WallpaperController>: 87 // InterfaceFactory<mojom::WallpaperController>:
94 void Create(const shell::Identity& remote_identity, 88 void Create(const shell::Identity& remote_identity,
95 mojom::WallpaperControllerRequest request) override; 89 mojom::WallpaperControllerRequest request) override;
96 90
97 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>: 91 // shell::InterfaceFactory<ui::mojom::AcceleratorRegistrar>:
98 void Create(const shell::Identity& remote_identity, 92 void Create(const shell::Identity& remote_identity,
99 ui::mojom::AcceleratorRegistrarRequest request) override; 93 ui::mojom::AcceleratorRegistrarRequest request) override;
100 94
101 // session::mojom::ScreenlockStateListener: 95 // session::mojom::ScreenlockStateListener:
102 void ScreenlockStateChanged(bool locked) override; 96 void ScreenlockStateChanged(bool locked) override;
103 97
104 tracing::Provider tracing_; 98 tracing::Provider tracing_;
105 99
106 std::unique_ptr<views::AuraInit> aura_init_; 100 std::unique_ptr<views::AuraInit> aura_init_;
107 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_; 101 std::unique_ptr<NativeWidgetFactoryMus> native_widget_factory_mus_;
108 102
109 std::unique_ptr<ui::GpuService> gpu_service_; 103 std::unique_ptr<ui::GpuService> gpu_service_;
110 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_; 104 std::unique_ptr<views::SurfaceContextFactory> compositor_context_factory_;
111 std::unique_ptr<WindowManager> window_manager_; 105 std::unique_ptr<WindowManager> window_manager_;
112 106
113 // 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.
114 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; 108 scoped_refptr<base::SequencedWorkerPool> blocking_pool_;
115 109
116 mojo::BindingSet<mojom::ShelfController> shelf_controller_bindings_; 110 mojo::BindingSet<mojom::ShelfController> shelf_controller_bindings_;
117 mojo::BindingSet<mojom::SystemTray> system_tray_bindings_;
118 mojo::BindingSet<mojom::WallpaperController> wallpaper_controller_bindings_; 111 mojo::BindingSet<mojom::WallpaperController> wallpaper_controller_bindings_;
119 112
120 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_; 113 std::set<AcceleratorRegistrarImpl*> accelerator_registrars_;
121 114
122 mash::session::mojom::SessionPtr session_; 115 mash::session::mojom::SessionPtr session_;
123 116
124 mojo::Binding<mash::session::mojom::ScreenlockStateListener> 117 mojo::Binding<mash::session::mojom::ScreenlockStateListener>
125 screenlock_state_listener_binding_; 118 screenlock_state_listener_binding_;
126 119
127 #if defined(OS_CHROMEOS) 120 #if defined(OS_CHROMEOS)
128 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> 121 std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider>
129 statistics_provider_; 122 statistics_provider_;
130 #endif 123 #endif
131 124
132 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication); 125 DISALLOW_COPY_AND_ASSIGN(WindowManagerApplication);
133 }; 126 };
134 127
135 } // namespace mus 128 } // namespace mus
136 } // namespace ash 129 } // namespace ash
137 130
138 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_ 131 #endif // ASH_MUS_WINDOW_MANAGER_APPLICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698