| OLD | NEW |
| 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/system/locale/locale_notification_controller.h" | 10 #include "ash/common/system/locale/locale_notification_controller.h" |
| 11 #include "ash/common/system/tray/system_tray_controller.h" | 11 #include "ash/common/system/tray/system_tray_controller.h" |
| 12 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 12 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
| 13 #include "base/bind.h" | 14 #include "base/bind.h" |
| 14 #include "services/service_manager/public/cpp/interface_registry.h" | 15 #include "services/service_manager/public/cpp/interface_registry.h" |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 void BindLocaleNotificationControllerOnMainThread( | 21 void BindLocaleNotificationControllerOnMainThread( |
| 21 mojom::LocaleNotificationControllerRequest request) { | 22 mojom::LocaleNotificationControllerRequest request) { |
| 22 WmShell::Get()->locale_notification_controller()->BindRequest( | 23 WmShell::Get()->locale_notification_controller()->BindRequest( |
| 23 std::move(request)); | 24 std::move(request)); |
| 24 } | 25 } |
| 25 | 26 |
| 26 void BindShelfControllerRequestOnMainThread( | 27 void BindShelfRequestOnMainThread(mojom::ShelfControllerRequest request) { |
| 27 mojom::ShelfControllerRequest request) { | |
| 28 WmShell::Get()->shelf_controller()->BindRequest(std::move(request)); | 28 WmShell::Get()->shelf_controller()->BindRequest(std::move(request)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) { | 31 void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) { |
| 32 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request)); | 32 WmShell::Get()->system_tray_controller()->BindRequest(std::move(request)); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void BindWallpaperRequestOnMainThread( |
| 36 mojom::WallpaperControllerRequest request) { |
| 37 WmShell::Get()->wallpaper_controller()->BindRequest(std::move(request)); |
| 38 } |
| 39 |
| 35 } // namespace | 40 } // namespace |
| 36 | 41 |
| 37 namespace mojo_interface_factory { | 42 namespace mojo_interface_factory { |
| 38 | 43 |
| 39 void RegisterInterfaces( | 44 void RegisterInterfaces( |
| 40 service_manager::InterfaceRegistry* registry, | 45 service_manager::InterfaceRegistry* registry, |
| 41 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { | 46 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { |
| 42 registry->AddInterface( | 47 registry->AddInterface( |
| 43 base::Bind(&BindLocaleNotificationControllerOnMainThread), | 48 base::Bind(&BindLocaleNotificationControllerOnMainThread), |
| 44 main_thread_task_runner); | 49 main_thread_task_runner); |
| 45 registry->AddInterface(base::Bind(&BindShelfControllerRequestOnMainThread), | 50 registry->AddInterface(base::Bind(&BindShelfRequestOnMainThread), |
| 46 main_thread_task_runner); | 51 main_thread_task_runner); |
| 47 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread), | 52 registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread), |
| 48 main_thread_task_runner); | 53 main_thread_task_runner); |
| 54 registry->AddInterface(base::Bind(&BindWallpaperRequestOnMainThread), |
| 55 main_thread_task_runner); |
| 49 } | 56 } |
| 50 | 57 |
| 51 } // namespace mojo_interface_factory | 58 } // namespace mojo_interface_factory |
| 52 | 59 |
| 53 } // namespace ash | 60 } // namespace ash |
| OLD | NEW |