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

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

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

Powered by Google App Engine
This is Rietveld 408576698