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

Side by Side Diff: device/generic_sensor/sensor_impl.cc

Issue 2288103002: [sensors] Add GetDefaultConfiguration() to generic sensor mojo interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 | « device/generic_sensor/sensor_impl.h ('k') | no next file » | 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 "device/generic_sensor/sensor_impl.h" 5 #include "device/generic_sensor/sensor_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 namespace device { 9 namespace device {
10 10
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 void SensorImpl::AddConfiguration( 27 void SensorImpl::AddConfiguration(
28 const PlatformSensorConfiguration& configuration, 28 const PlatformSensorConfiguration& configuration,
29 const AddConfigurationCallback& callback) { 29 const AddConfigurationCallback& callback) {
30 // TODO(Mikhail): To avoid overflowing browser by repeated AddConfigs 30 // TODO(Mikhail): To avoid overflowing browser by repeated AddConfigs
31 // (maybe limit the number of configs per client). 31 // (maybe limit the number of configs per client).
32 callback.Run(sensor_->StartListening(this, configuration)); 32 callback.Run(sensor_->StartListening(this, configuration));
33 } 33 }
34 34
35 void SensorImpl::GetDefaultConfiguration(
36 const GetDefaultConfigurationCallback& callback) {
37 callback.Run(sensor_->GetDefaultConfiguration());
38 }
39
35 void SensorImpl::RemoveConfiguration( 40 void SensorImpl::RemoveConfiguration(
36 const PlatformSensorConfiguration& configuration, 41 const PlatformSensorConfiguration& configuration,
37 const RemoveConfigurationCallback& callback) { 42 const RemoveConfigurationCallback& callback) {
38 callback.Run(sensor_->StopListening(this, configuration)); 43 callback.Run(sensor_->StopListening(this, configuration));
39 } 44 }
40 45
41 void SensorImpl::Suspend() { 46 void SensorImpl::Suspend() {
42 suspended_ = true; 47 suspended_ = true;
43 sensor_->UpdateSensor(); 48 sensor_->UpdateSensor();
44 } 49 }
(...skipping 13 matching lines...) Expand all
58 DCHECK(!suspended_); 63 DCHECK(!suspended_);
59 if (client_) 64 if (client_)
60 client_->RaiseError(); 65 client_->RaiseError();
61 } 66 }
62 67
63 bool SensorImpl::IsNotificationSuspended() { 68 bool SensorImpl::IsNotificationSuspended() {
64 return suspended_; 69 return suspended_;
65 } 70 }
66 71
67 } // namespace device 72 } // namespace device
OLDNEW
« no previous file with comments | « device/generic_sensor/sensor_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698