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