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

Side by Side Diff: services/device/device_service.cc

Issue 2510033002: [Device Service] Move PowerMonitor into the Device Service (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
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 "services/device/device_service.h" 5 #include "services/device/device_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "device/power_monitor/power_monitor_message_broadcaster.h"
10 #include "services/service_manager/public/cpp/connection.h" 11 #include "services/service_manager/public/cpp/connection.h"
12 #include "services/service_manager/public/cpp/interface_registry.h"
11 13
12 namespace device { 14 namespace device {
13 15
14 std::unique_ptr<service_manager::Service> CreateDeviceService( 16 std::unique_ptr<service_manager::Service> CreateDeviceService(
15 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) { 17 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) {
16 return base::MakeUnique<DeviceService>(std::move(file_task_runner)); 18 return base::MakeUnique<DeviceService>(std::move(file_task_runner));
17 } 19 }
18 20
19 DeviceService::DeviceService( 21 DeviceService::DeviceService(
20 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) 22 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner)
21 : file_task_runner_(std::move(file_task_runner)) {} 23 : file_task_runner_(std::move(file_task_runner)) {}
22 24
23 DeviceService::~DeviceService() {} 25 DeviceService::~DeviceService() {}
24 26
25 void DeviceService::OnStart() {} 27 void DeviceService::OnStart() {}
26 28
27 bool DeviceService::OnConnect(const service_manager::ServiceInfo& remote_info, 29 bool DeviceService::OnConnect(const service_manager::ServiceInfo& remote_info,
28 service_manager::InterfaceRegistry* registry) { 30 service_manager::InterfaceRegistry* registry) {
31 registry->AddInterface<mojom::PowerMonitor>(this);
29 return true; 32 return true;
30 } 33 }
31 34
35 void DeviceService::Create(const service_manager::Identity& remote_identity,
36 mojom::PowerMonitorRequest request) {
37 PowerMonitorMessageBroadcaster::Create(std::move(request));
38 }
39
32 } // namespace device 40 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698