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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_
6 #define CONTENT_BROWSER_DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_
8 #include <IOKit/IOKitLib.h>
10 #include "base/memory/scoped_ptr.h"
14 // Provides an interface to retrieve ambient light data from MacBooks.
15 class AmbientLightSensor
{
17 // Create AmbientLightSensor object, return NULL if no valid is sensor found.
18 static scoped_ptr
<AmbientLightSensor
> Create();
20 ~AmbientLightSensor();
22 // Retrieve lux values from Ambient Light Sensor.
23 bool ReadSensorValue(uint64_t lux_value
[2]);
28 // Probe the local hardware looking for Ambient Light sensor and
29 // initialize an I/O connection to it.
32 // IOKit connection to the local sensor.
33 io_connect_t io_connection_
;
35 DISALLOW_COPY_AND_ASSIGN(AmbientLightSensor
);
38 } // namespace content
40 #endif // CONTENT_BROWSER_DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_