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

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

Issue 2801173004: Add '.mojom' suffix for battery mojom modules. (Closed)
Patch Set: Rebase only Created 3 years, 8 months 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 | « services/device/device_service.h ('k') | services/device/manifest.json » ('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 "services/device/device_service.h" 5 #include "services/device/device_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 registry_.AddInterface<mojom::LightSensor>(this); 88 registry_.AddInterface<mojom::LightSensor>(this);
89 registry_.AddInterface<mojom::MotionSensor>(this); 89 registry_.AddInterface<mojom::MotionSensor>(this);
90 registry_.AddInterface<mojom::OrientationSensor>(this); 90 registry_.AddInterface<mojom::OrientationSensor>(this);
91 registry_.AddInterface<mojom::OrientationAbsoluteSensor>(this); 91 registry_.AddInterface<mojom::OrientationAbsoluteSensor>(this);
92 registry_.AddInterface<mojom::PowerMonitor>(this); 92 registry_.AddInterface<mojom::PowerMonitor>(this);
93 registry_.AddInterface<mojom::ScreenOrientationListener>(this); 93 registry_.AddInterface<mojom::ScreenOrientationListener>(this);
94 registry_.AddInterface<mojom::TimeZoneMonitor>(this); 94 registry_.AddInterface<mojom::TimeZoneMonitor>(this);
95 registry_.AddInterface<mojom::WakeLockContextProvider>(this); 95 registry_.AddInterface<mojom::WakeLockContextProvider>(this);
96 96
97 #if defined(OS_ANDROID) 97 #if defined(OS_ANDROID)
98 registry_.AddInterface( 98 registry_.AddInterface(GetJavaInterfaceProvider()
99 GetJavaInterfaceProvider()->CreateInterfaceFactory<BatteryMonitor>()); 99 ->CreateInterfaceFactory<mojom::BatteryMonitor>());
100 registry_.AddInterface( 100 registry_.AddInterface(
101 GetJavaInterfaceProvider() 101 GetJavaInterfaceProvider()
102 ->CreateInterfaceFactory<mojom::VibrationManager>()); 102 ->CreateInterfaceFactory<mojom::VibrationManager>());
103 #else 103 #else
104 registry_.AddInterface<BatteryMonitor>(this); 104 registry_.AddInterface<mojom::BatteryMonitor>(this);
105 registry_.AddInterface<mojom::VibrationManager>(this); 105 registry_.AddInterface<mojom::VibrationManager>(this);
106 #endif 106 #endif
107 } 107 }
108 108
109 void DeviceService::OnBindInterface( 109 void DeviceService::OnBindInterface(
110 const service_manager::ServiceInfo& source_info, 110 const service_manager::ServiceInfo& source_info,
111 const std::string& interface_name, 111 const std::string& interface_name,
112 mojo::ScopedMessagePipeHandle interface_pipe) { 112 mojo::ScopedMessagePipeHandle interface_pipe) {
113 registry_.BindInterface(source_info.identity, interface_name, 113 registry_.BindInterface(source_info.identity, interface_name,
114 std::move(interface_pipe)); 114 std::move(interface_pipe));
115 } 115 }
116 116
117 #if !defined(OS_ANDROID) 117 #if !defined(OS_ANDROID)
118 void DeviceService::Create(const service_manager::Identity& remote_identity, 118 void DeviceService::Create(const service_manager::Identity& remote_identity,
119 BatteryMonitorRequest request) { 119 mojom::BatteryMonitorRequest request) {
120 device::BatteryMonitorImpl::Create(std::move(request)); 120 BatteryMonitorImpl::Create(std::move(request));
121 } 121 }
122 122
123 void DeviceService::Create(const service_manager::Identity& remote_identity, 123 void DeviceService::Create(const service_manager::Identity& remote_identity,
124 mojom::VibrationManagerRequest request) { 124 mojom::VibrationManagerRequest request) {
125 VibrationManagerImpl::Create(std::move(request)); 125 VibrationManagerImpl::Create(std::move(request));
126 } 126 }
127 #endif 127 #endif
128 128
129 void DeviceService::Create(const service_manager::Identity& remote_identity, 129 void DeviceService::Create(const service_manager::Identity& remote_identity,
130 mojom::FingerprintRequest request) { 130 mojom::FingerprintRequest request) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 java_interface_provider_.Bind(std::move(provider)); 241 java_interface_provider_.Bind(std::move(provider));
242 242
243 java_interface_provider_initialized_ = true; 243 java_interface_provider_initialized_ = true;
244 } 244 }
245 245
246 return &java_interface_provider_; 246 return &java_interface_provider_;
247 } 247 }
248 #endif 248 #endif
249 249
250 } // namespace device 250 } // namespace device
OLDNEW
« no previous file with comments | « services/device/device_service.h ('k') | services/device/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698