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

Side by Side Diff: ash/common/mojo_interface_factory.cc

Issue 2497123002: chromeos: Move device shutdown handling out of chrome into ash (Closed)
Patch Set: rebase Created 4 years, 1 month 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/BUILD.gn ('k') | ash/common/shutdown_controller.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/mojo_interface_factory.h" 5 #include "ash/common/mojo_interface_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_controller.h" 9 #include "ash/common/shelf/shelf_controller.h"
10 #include "ash/common/shutdown_controller.h"
10 #include "ash/common/system/locale/locale_notification_controller.h" 11 #include "ash/common/system/locale/locale_notification_controller.h"
11 #include "ash/common/system/tray/system_tray_controller.h" 12 #include "ash/common/system/tray/system_tray_controller.h"
12 #include "ash/common/wallpaper/wallpaper_controller.h" 13 #include "ash/common/wallpaper/wallpaper_controller.h"
13 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
14 #include "base/bind.h" 15 #include "base/bind.h"
15 #include "services/service_manager/public/cpp/interface_registry.h" 16 #include "services/service_manager/public/cpp/interface_registry.h"
16 17
17 namespace ash { 18 namespace ash {
18 19
19 namespace { 20 namespace {
20 21
21 void BindLocaleNotificationControllerOnMainThread( 22 void BindLocaleNotificationControllerOnMainThread(
22 mojom::LocaleNotificationControllerRequest request) { 23 mojom::LocaleNotificationControllerRequest request) {
23 WmShell::Get()->locale_notification_controller()->BindRequest( 24 WmShell::Get()->locale_notification_controller()->BindRequest(
24 std::move(request)); 25 std::move(request));
25 } 26 }
26 27
27 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) { 28 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) {
28 WmShell::Get()->shelf_controller()->BindRequest(std::move(request)); 29 WmShell::Get()->shelf_controller()->BindRequest(std::move(request));
29 } 30 }
30 31
32 void BindShutdownControllerRequestOnMainThread(
33 mojom::ShutdownControllerRequest request) {
34 WmShell::Get()->shutdown_controller()->BindRequest(std::move(request));
35 }
36
31 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) { 37 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) {
32 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request)); 38 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request));
33 } 39 }
34 40
35 void BindWallpaperRequestOnMainThread( 41 void BindWallpaperRequestOnMainThread(
36 mojom::WallpaperControllerRequest request) { 42 mojom::WallpaperControllerRequest request) {
37 WmShell::Get()->wallpaper_controller()->BindRequest(std::move(request)); 43 WmShell::Get()->wallpaper_controller()->BindRequest(std::move(request));
38 } 44 }
39 45
40 } // namespace 46 } // namespace
41 47
42 namespace mojo_interface_factory { 48 namespace mojo_interface_factory {
43 49
44 void RegisterInterfaces( 50 void RegisterInterfaces(
45 service_manager::InterfaceRegistry* registry, 51 service_manager::InterfaceRegistry* registry,
46 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { 52 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
47 registry->AddInterface( 53 registry->AddInterface(
48 base::Bind(&BindLocaleNotificationControllerOnMainThread), 54 base::Bind(&BindLocaleNotificationControllerOnMainThread),
49 main_thread_task_runner); 55 main_thread_task_runner);
50 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread), 56 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread),
51 main_thread_task_runner); 57 main_thread_task_runner);
58 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread),
59 main_thread_task_runner);
52 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread), 60 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread),
53 main_thread_task_runner); 61 main_thread_task_runner);
54 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread), 62 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread),
55 main_thread_task_runner); 63 main_thread_task_runner);
56 } 64 }
57 65
58 } // namespace mojo_interface_factory 66 } // namespace mojo_interface_factory
59 67
60 } // namespace ash 68 } // namespace ash
OLDNEW
« no previous file with comments | « ash/BUILD.gn ('k') | ash/common/shutdown_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698