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

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

Issue 2552483002: mash: Have chrome set itself as a controller interface for changing volume (Closed)
Patch Set: rebase 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/accelerators/accelerator_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/maximize_mode/maximize_mode_controller.h" 15 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
15 #include "ash/common/wm_shell.h" 16 #include "ash/common/wm_shell.h"
16 #include "base/bind.h" 17 #include "base/bind.h"
17 #include "services/service_manager/public/cpp/interface_registry.h" 18 #include "services/service_manager/public/cpp/interface_registry.h"
18 19
(...skipping 21 matching lines...) Expand all
40 } 41 }
41 42
42 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) { 43 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) {
43 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request)); 44 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request));
44 } 45 }
45 46
46 void BindTouchViewRequestOnMainThread(mojom::TouchViewManagerRequest request) { 47 void BindTouchViewRequestOnMainThread(mojom::TouchViewManagerRequest request) {
47 WmShell::Get()->maximize_mode_controller()->BindRequest(std::move(request)); 48 WmShell::Get()->maximize_mode_controller()->BindRequest(std::move(request));
48 } 49 }
49 50
51 void BindVolumeRequestOnMainThread(mojom::VolumeRequest request) {
52 WmShell::Get()->accelerator_controller()->BindRequest(std::move(request));
53 }
54
50 #if defined(OS_CHROMEOS) 55 #if defined(OS_CHROMEOS)
51 void BindVpnListRequestOnMainThread(mojom::VpnListRequest request) { 56 void BindVpnListRequestOnMainThread(mojom::VpnListRequest request) {
52 WmShell::Get()->vpn_list()->BindRequest(std::move(request)); 57 WmShell::Get()->vpn_list()->BindRequest(std::move(request));
53 } 58 }
54 #endif 59 #endif
55 60
56 void BindWallpaperRequestOnMainThread( 61 void BindWallpaperRequestOnMainThread(
57 mojom::WallpaperControllerRequest request) { 62 mojom::WallpaperControllerRequest request) {
58 WmShell::Get()->wallpaper_controller()->BindRequest(std::move(request)); 63 WmShell::Get()->wallpaper_controller()->BindRequest(std::move(request));
59 } 64 }
60 65
61 } // namespace 66 } // namespace
62 67
63 namespace mojo_interface_factory { 68 namespace mojo_interface_factory {
64 69
65 void RegisterInterfaces( 70 void RegisterInterfaces(
66 service_manager::InterfaceRegistry* registry, 71 service_manager::InterfaceRegistry* registry,
67 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { 72 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
68 registry->AddInterface( 73 registry->AddInterface(
69 base::Bind(&BindLocaleNotificationControllerOnMainThread), 74 base::Bind(&BindLocaleNotificationControllerOnMainThread),
70 main_thread_task_runner); 75 main_thread_task_runner);
71 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread), 76 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread),
72 main_thread_task_runner); 77 main_thread_task_runner);
73 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread), 78 registry->AddInterface(base::Bind(&BindShutdownControllerRequestOnMainThread),
74 main_thread_task_runner); 79 main_thread_task_runner);
75 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread), 80 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread),
76 main_thread_task_runner); 81 main_thread_task_runner);
77 registry->AddInterface(base::Bind(&BindTouchViewRequestOnMainThread), 82 registry->AddInterface(base::Bind(&BindTouchViewRequestOnMainThread),
78 main_thread_task_runner); 83 main_thread_task_runner);
84 registry->AddInterface(base::Bind(&BindVolumeRequestOnMainThread),
85 main_thread_task_runner);
79 #if defined(OS_CHROMEOS) 86 #if defined(OS_CHROMEOS)
80 registry->AddInterface(base::Bind(&BindVpnListRequestOnMainThread), 87 registry->AddInterface(base::Bind(&BindVpnListRequestOnMainThread),
81 main_thread_task_runner); 88 main_thread_task_runner);
82 #endif 89 #endif
83 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread), 90 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread),
84 main_thread_task_runner); 91 main_thread_task_runner);
85 } 92 }
86 93
87 } // namespace mojo_interface_factory 94 } // namespace mojo_interface_factory
88 95
89 } // namespace ash 96 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698