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 #include "ash/mus/window_manager_application.h" | 5 #include "ash/mus/window_manager_application.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/system/tray/system_tray_controller.h" |
10 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
11 #include "ash/mus/accelerators/accelerator_registrar_impl.h" | 12 #include "ash/mus/accelerators/accelerator_registrar_impl.h" |
12 #include "ash/mus/native_widget_factory_mus.h" | 13 #include "ash/mus/native_widget_factory_mus.h" |
13 #include "ash/mus/shelf_delegate_mus.h" | 14 #include "ash/mus/shelf_delegate_mus.h" |
14 #include "ash/mus/system_tray_delegate_mus.h" | |
15 #include "ash/mus/wallpaper_delegate_mus.h" | 15 #include "ash/mus/wallpaper_delegate_mus.h" |
16 #include "ash/mus/window_manager.h" | 16 #include "ash/mus/window_manager.h" |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
19 #include "services/shell/public/cpp/connection.h" | 19 #include "services/shell/public/cpp/connection.h" |
20 #include "services/shell/public/cpp/connector.h" | 20 #include "services/shell/public/cpp/connector.h" |
21 #include "services/tracing/public/cpp/provider.h" | 21 #include "services/tracing/public/cpp/provider.h" |
22 #include "services/ui/common/event_matcher_util.h" | 22 #include "services/ui/common/event_matcher_util.h" |
23 #include "services/ui/public/cpp/gpu_service.h" | 23 #include "services/ui/public/cpp/gpu_service.h" |
24 #include "services/ui/public/cpp/window.h" | 24 #include "services/ui/public/cpp/window.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 void WindowManagerApplication::Create(const shell::Identity& remote_identity, | 169 void WindowManagerApplication::Create(const shell::Identity& remote_identity, |
170 mojom::ShelfControllerRequest request) { | 170 mojom::ShelfControllerRequest request) { |
171 mojom::ShelfController* shelf_controller = | 171 mojom::ShelfController* shelf_controller = |
172 static_cast<ShelfDelegateMus*>(WmShell::Get()->shelf_delegate()); | 172 static_cast<ShelfDelegateMus*>(WmShell::Get()->shelf_delegate()); |
173 DCHECK(shelf_controller); | 173 DCHECK(shelf_controller); |
174 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); | 174 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); |
175 } | 175 } |
176 | 176 |
177 void WindowManagerApplication::Create(const shell::Identity& remote_identity, | 177 void WindowManagerApplication::Create(const shell::Identity& remote_identity, |
178 mojom::SystemTrayRequest request) { | 178 mojom::SystemTrayRequest request) { |
179 mojom::SystemTray* system_tray = SystemTrayDelegateMus::Get(); | 179 // Look mom, no cast! |
| 180 mojom::SystemTray* system_tray = WmShell::Get()->system_tray_controller(); |
180 DCHECK(system_tray); | 181 DCHECK(system_tray); |
181 system_tray_bindings_.AddBinding(system_tray, std::move(request)); | 182 system_tray_bindings_.AddBinding(system_tray, std::move(request)); |
182 } | 183 } |
183 | 184 |
184 void WindowManagerApplication::Create( | 185 void WindowManagerApplication::Create( |
185 const ::shell::Identity& remote_identity, | 186 const ::shell::Identity& remote_identity, |
186 mojom::WallpaperControllerRequest request) { | 187 mojom::WallpaperControllerRequest request) { |
187 mojom::WallpaperController* wallpaper_controller = | 188 mojom::WallpaperController* wallpaper_controller = |
188 static_cast<WallpaperDelegateMus*>(WmShell::Get()->wallpaper_delegate()); | 189 static_cast<WallpaperDelegateMus*>(WmShell::Get()->wallpaper_delegate()); |
189 DCHECK(wallpaper_controller); | 190 DCHECK(wallpaper_controller); |
(...skipping 19 matching lines...) Expand all Loading... |
209 base::Bind(&WindowManagerApplication::OnAcceleratorRegistrarDestroyed, | 210 base::Bind(&WindowManagerApplication::OnAcceleratorRegistrarDestroyed, |
210 base::Unretained(this)))); | 211 base::Unretained(this)))); |
211 } | 212 } |
212 | 213 |
213 void WindowManagerApplication::ScreenlockStateChanged(bool locked) { | 214 void WindowManagerApplication::ScreenlockStateChanged(bool locked) { |
214 window_manager_->SetScreenLocked(locked); | 215 window_manager_->SetScreenLocked(locked); |
215 } | 216 } |
216 | 217 |
217 } // namespace mus | 218 } // namespace mus |
218 } // namespace ash | 219 } // namespace ash |
OLD | NEW |