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

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

Issue 2545723003: ash: Add SessionController/Client mojo interfaces (Closed)
Patch Set: fix gn check and address comments in #6 Created 4 years 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 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/cast_config_controller.h" 9 #include "ash/common/cast_config_controller.h"
10 #include "ash/common/session/session_controller.h"
10 #include "ash/common/shelf/shelf_controller.h" 11 #include "ash/common/shelf/shelf_controller.h"
11 #include "ash/common/shutdown_controller.h" 12 #include "ash/common/shutdown_controller.h"
12 #include "ash/common/system/locale/locale_notification_controller.h" 13 #include "ash/common/system/locale/locale_notification_controller.h"
13 #include "ash/common/system/tray/system_tray_controller.h" 14 #include "ash/common/system/tray/system_tray_controller.h"
14 #include "ash/common/wallpaper/wallpaper_controller.h" 15 #include "ash/common/wallpaper/wallpaper_controller.h"
15 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 16 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
16 #include "ash/common/wm_shell.h" 17 #include "ash/common/wm_shell.h"
17 #include "base/bind.h" 18 #include "base/bind.h"
18 #include "services/service_manager/public/cpp/interface_registry.h" 19 #include "services/service_manager/public/cpp/interface_registry.h"
19 20
20 #if defined(OS_CHROMEOS) 21 #if defined(OS_CHROMEOS)
21 #include "ash/common/system/chromeos/network/vpn_list.h" 22 #include "ash/common/system/chromeos/network/vpn_list.h"
22 #endif 23 #endif
23 24
24 namespace ash { 25 namespace ash {
25 26
26 namespace { 27 namespace {
27 28
28 void BindCastConfigOnMainThread(mojom::CastConfigRequest request) { 29 void BindCastConfigOnMainThread(mojom::CastConfigRequest request) {
29 WmShell::Get()->cast_config()->BindRequest(std::move(request)); 30 WmShell::Get()->cast_config()->BindRequest(std::move(request));
30 } 31 }
31 32
32 void BindLocaleNotificationControllerOnMainThread( 33 void BindLocaleNotificationControllerOnMainThread(
33 mojom::LocaleNotificationControllerRequest request) { 34 mojom::LocaleNotificationControllerRequest request) {
34 WmShell::Get()->locale_notification_controller()->BindRequest( 35 WmShell::Get()->locale_notification_controller()->BindRequest(
35 std::move(request)); 36 std::move(request));
36 } 37 }
37 38
39 void BindSessionControllerRequestOnMainThread(
40 mojom::SessionControllerRequest request) {
41 WmShell::Get()->session_controller()->BindRequest(std::move(request));
42 }
43
38 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) { 44 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) {
39 WmShell::Get()->shelf_controller()->BindRequest(std::move(request)); 45 WmShell::Get()->shelf_controller()->BindRequest(std::move(request));
40 } 46 }
41 47
42 void BindShutdownControllerRequestOnMainThread( 48 void BindShutdownControllerRequestOnMainThread(
43 mojom::ShutdownControllerRequest request) { 49 mojom::ShutdownControllerRequest request) {
44 WmShell::Get()->shutdown_controller()->BindRequest(std::move(request)); 50 WmShell::Get()->shutdown_controller()->BindRequest(std::move(request));
45 } 51 }
46 52
47 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) { 53 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) {
(...skipping 20 matching lines...) Expand all
68 namespace mojo_interface_factory { 74 namespace mojo_interface_factory {
69 75
70 void RegisterInterfaces( 76 void RegisterInterfaces(
71 service_manager::InterfaceRegistry* registry, 77 service_manager::InterfaceRegistry* registry,
72 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { 78 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
73 registry->AddInterface(base::Bind(&BindCastConfigOnMainThread), 79 registry->AddInterface(base::Bind(&BindCastConfigOnMainThread),
74 main_thread_task_runner); 80 main_thread_task_runner);
75 registry->AddInterface( 81 registry->AddInterface(
76 base::Bind(&BindLocaleNotificationControllerOnMainThread), 82 base::Bind(&BindLocaleNotificationControllerOnMainThread),
77 main_thread_task_runner); 83 main_thread_task_runner);
84 registry->AddInterface(base::Bind(&BindSessionControllerRequestOnMainThread),
85 main_thread_task_runner);
78 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread), 86 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread),
79 main_thread_task_runner); 87 main_thread_task_runner);
80 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread), 88 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread),
81 main_thread_task_runner); 89 main_thread_task_runner);
82 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread), 90 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread),
83 main_thread_task_runner); 91 main_thread_task_runner);
84 registry->AddInterface(base::Bind(&BindTouchViewRequestOnMainThread), 92 registry->AddInterface(base::Bind(&BindTouchViewRequestOnMainThread),
85 main_thread_task_runner); 93 main_thread_task_runner);
86 #if defined(OS_CHROMEOS) 94 #if defined(OS_CHROMEOS)
87 registry->AddInterface(base::Bind(&BindVpnListRequestOnMainThread), 95 registry->AddInterface(base::Bind(&BindVpnListRequestOnMainThread),
88 main_thread_task_runner); 96 main_thread_task_runner);
89 #endif 97 #endif
90 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread), 98 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread),
91 main_thread_task_runner); 99 main_thread_task_runner);
92 } 100 }
93 101
94 } // namespace mojo_interface_factory 102 } // namespace mojo_interface_factory
95 103
96 } // namespace ash 104 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698