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

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

Issue 2522613004: Revert of chromeos: Convert ash VPNDelegate interface to mojo (Closed)
Patch Set: 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/common/BUILD.gn ('k') | ash/common/system/chromeos/network/tray_vpn.cc » ('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/shutdown_controller.h"
11 #include "ash/common/system/locale/locale_notification_controller.h" 11 #include "ash/common/system/locale/locale_notification_controller.h"
12 #include "ash/common/system/tray/system_tray_controller.h" 12 #include "ash/common/system/tray/system_tray_controller.h"
13 #include "ash/common/wallpaper/wallpaper_controller.h" 13 #include "ash/common/wallpaper/wallpaper_controller.h"
14 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
15 #include "base/bind.h" 15 #include "base/bind.h"
16 #include "services/service_manager/public/cpp/interface_registry.h" 16 #include "services/service_manager/public/cpp/interface_registry.h"
17 17
18 #if defined(OS_CHROMEOS)
19 #include "ash/common/system/chromeos/network/vpn_list.h"
20 #endif
21
22 namespace ash { 18 namespace ash {
23 19
24 namespace { 20 namespace {
25 21
26 void BindLocaleNotificationControllerOnMainThread( 22 void BindLocaleNotificationControllerOnMainThread(
27 mojom::LocaleNotificationControllerRequest request) { 23 mojom::LocaleNotificationControllerRequest request) {
28 WmShell::Get()->locale_notification_controller()->BindRequest( 24 WmShell::Get()->locale_notification_controller()->BindRequest(
29 std::move(request)); 25 std::move(request));
30 } 26 }
31 27
32 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) { 28 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) {
33 WmShell::Get()->shelf_controller()->BindRequest(std::move(request)); 29 WmShell::Get()->shelf_controller()->BindRequest(std::move(request));
34 } 30 }
35 31
36 void BindShutdownControllerRequestOnMainThread( 32 void BindShutdownControllerRequestOnMainThread(
37 mojom::ShutdownControllerRequest request) { 33 mojom::ShutdownControllerRequest request) {
38 WmShell::Get()->shutdown_controller()->BindRequest(std::move(request)); 34 WmShell::Get()->shutdown_controller()->BindRequest(std::move(request));
39 } 35 }
40 36
41 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) { 37 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) {
42 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request)); 38 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request));
43 } 39 }
44 40
45 #if defined(OS_CHROMEOS)
46 void BindVpnListRequestOnMainThread(mojom::VpnListRequest request) {
47 WmShell::Get()->vpn_list()->BindRequest(std::move(request));
48 }
49 #endif
50
51 void BindWallpaperRequestOnMainThread( 41 void BindWallpaperRequestOnMainThread(
52 mojom::WallpaperControllerRequest request) { 42 mojom::WallpaperControllerRequest request) {
53 WmShell::Get()->wallpaper_controller()->BindRequest(std::move(request)); 43 WmShell::Get()->wallpaper_controller()->BindRequest(std::move(request));
54 } 44 }
55 45
56 } // namespace 46 } // namespace
57 47
58 namespace mojo_interface_factory { 48 namespace mojo_interface_factory {
59 49
60 void RegisterInterfaces( 50 void RegisterInterfaces(
61 service_manager::InterfaceRegistry* registry, 51 service_manager::InterfaceRegistry* registry,
62 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { 52 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
63 registry->AddInterface( 53 registry->AddInterface(
64 base::Bind(&BindLocaleNotificationControllerOnMainThread), 54 base::Bind(&BindLocaleNotificationControllerOnMainThread),
65 main_thread_task_runner); 55 main_thread_task_runner);
66 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread), 56 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread),
67 main_thread_task_runner); 57 main_thread_task_runner);
68 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread), 58 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread),
69 main_thread_task_runner); 59 main_thread_task_runner);
70 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread), 60 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread),
71 main_thread_task_runner); 61 main_thread_task_runner);
72 #if defined(OS_CHROMEOS)
73 registry->AddInterface(base::Bind(&BindVpnListRequestOnMainThread),
74 main_thread_task_runner);
75 #endif
76 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread), 62 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread),
77 main_thread_task_runner); 63 main_thread_task_runner);
78 } 64 }
79 65
80 } // namespace mojo_interface_factory 66 } // namespace mojo_interface_factory
81 67
82 } // namespace ash 68 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/BUILD.gn ('k') | ash/common/system/chromeos/network/tray_vpn.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698