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

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

Issue 2545723003: ash: Add SessionController/Client mojo interfaces (Closed)
Patch Set: use a default to fix null avatar image failures 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/session/session_controller.h"
9 #include "ash/common/shelf/shelf_controller.h" 10 #include "ash/common/shelf/shelf_controller.h"
10 #include "ash/common/shutdown_controller.h" 11 #include "ash/common/shutdown_controller.h"
11 #include "ash/common/system/locale/locale_notification_controller.h" 12 #include "ash/common/system/locale/locale_notification_controller.h"
12 #include "ash/common/system/tray/system_tray_controller.h" 13 #include "ash/common/system/tray/system_tray_controller.h"
13 #include "ash/common/wallpaper/wallpaper_controller.h" 14 #include "ash/common/wallpaper/wallpaper_controller.h"
14 #include "ash/common/wm_shell.h" 15 #include "ash/common/wm_shell.h"
15 #include "base/bind.h" 16 #include "base/bind.h"
16 #include "services/service_manager/public/cpp/interface_registry.h" 17 #include "services/service_manager/public/cpp/interface_registry.h"
17 18
18 #if defined(OS_CHROMEOS) 19 #if defined(OS_CHROMEOS)
19 #include "ash/common/system/chromeos/network/vpn_list.h" 20 #include "ash/common/system/chromeos/network/vpn_list.h"
20 #endif 21 #endif
21 22
22 namespace ash { 23 namespace ash {
23 24
24 namespace { 25 namespace {
25 26
26 void BindLocaleNotificationControllerOnMainThread( 27 void BindLocaleNotificationControllerOnMainThread(
27 mojom::LocaleNotificationControllerRequest request) { 28 mojom::LocaleNotificationControllerRequest request) {
28 WmShell::Get()->locale_notification_controller()->BindRequest( 29 WmShell::Get()->locale_notification_controller()->BindRequest(
29 std::move(request)); 30 std::move(request));
30 } 31 }
31 32
33 void BindSessionControllerRequestOnMainThread(
34 mojom::SessionControllerRequest request) {
35 WmShell::Get()->session_controller()->BindRequest(std::move(request));
36 }
37
32 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) { 38 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) {
33 WmShell::Get()->shelf_controller()->BindRequest(std::move(request)); 39 WmShell::Get()->shelf_controller()->BindRequest(std::move(request));
34 } 40 }
35 41
36 void BindShutdownControllerRequestOnMainThread( 42 void BindShutdownControllerRequestOnMainThread(
37 mojom::ShutdownControllerRequest request) { 43 mojom::ShutdownControllerRequest request) {
38 WmShell::Get()->shutdown_controller()->BindRequest(std::move(request)); 44 WmShell::Get()->shutdown_controller()->BindRequest(std::move(request));
39 } 45 }
40 46
41 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) { 47 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) {
(...skipping 14 matching lines...) Expand all
56 } // namespace 62 } // namespace
57 63
58 namespace mojo_interface_factory { 64 namespace mojo_interface_factory {
59 65
60 void RegisterInterfaces( 66 void RegisterInterfaces(
61 service_manager::InterfaceRegistry* registry, 67 service_manager::InterfaceRegistry* registry,
62 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { 68 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
63 registry->AddInterface( 69 registry->AddInterface(
64 base::Bind(&BindLocaleNotificationControllerOnMainThread), 70 base::Bind(&BindLocaleNotificationControllerOnMainThread),
65 main_thread_task_runner); 71 main_thread_task_runner);
72 registry->AddInterface(base::Bind(&BindSessionControllerRequestOnMainThread),
73 main_thread_task_runner);
66 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread), 74 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread),
67 main_thread_task_runner); 75 main_thread_task_runner);
68 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread), 76 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread),
69 main_thread_task_runner); 77 main_thread_task_runner);
70 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread), 78 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread),
71 main_thread_task_runner); 79 main_thread_task_runner);
72 #if defined(OS_CHROMEOS) 80 #if defined(OS_CHROMEOS)
73 registry->AddInterface(base::Bind(&BindVpnListRequestOnMainThread), 81 registry->AddInterface(base::Bind(&BindVpnListRequestOnMainThread),
74 main_thread_task_runner); 82 main_thread_task_runner);
75 #endif 83 #endif
76 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread), 84 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread),
77 main_thread_task_runner); 85 main_thread_task_runner);
78 } 86 }
79 87
80 } // namespace mojo_interface_factory 88 } // namespace mojo_interface_factory
81 89
82 } // namespace ash 90 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698