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

Side by Side Diff: services/device/sensors/ambient_light_mac.cc

Issue 2819273006: Move //device/sensor impl to be part of the internal implemenation of the Device Service. (Closed)
Patch Set: Move //device/sensor impl to be part of the internal implemenation of the Device Service 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // This file is based on http://osxbook.com/book/bonus/chapter10/light/ 5 // This file is based on http://osxbook.com/book/bonus/chapter10/light/
6 6
7 #include "device/sensors/ambient_light_mac.h" 7 #include "services/device/sensors/ambient_light_mac.h"
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/mac/scoped_cftyperef.h" 11 #include "base/mac/scoped_cftyperef.h"
12 #include "base/mac/scoped_ioobject.h" 12 #include "base/mac/scoped_ioobject.h"
13 13
14 namespace device { 14 namespace device {
15 15
16 namespace { 16 namespace {
17 enum LmuFunctionIndex { 17 enum LmuFunctionIndex {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool AmbientLightSensor::ReadSensorValue(uint64_t lux_values[2]) { 70 bool AmbientLightSensor::ReadSensorValue(uint64_t lux_values[2]) {
71 uint32_t scalar_output_count = 2; 71 uint32_t scalar_output_count = 2;
72 kern_return_t kr = IOConnectCallMethod( 72 kern_return_t kr = IOConnectCallMethod(
73 io_connection_, LmuFunctionIndex::kGetSensorReadingID, nullptr, 0, 73 io_connection_, LmuFunctionIndex::kGetSensorReadingID, nullptr, 0,
74 nullptr, 0, lux_values, &scalar_output_count, nullptr, 0); 74 nullptr, 0, lux_values, &scalar_output_count, nullptr, 0);
75 75
76 return kr == KERN_SUCCESS; 76 return kr == KERN_SUCCESS;
77 } 77 }
78 78
79 } // namespace device 79 } // namespace device
OLDNEW
« no previous file with comments | « services/device/sensors/ambient_light_mac.h ('k') | services/device/sensors/android/device_sensor_jni_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698