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

Unified Diff: ambient_light_sensor.h

Issue 6307010: Use Signal Callback in Ambient Light Sensor (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/power_manager.git@master
Patch Set: Added comments for ReadAls and Deffered Init. Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ambient_light_sensor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ambient_light_sensor.h
diff --git a/ambient_light_sensor.h b/ambient_light_sensor.h
index 0442a831f28a90d653913d674f3a0478e85b28a0..6409ccf3a58dfadfb177ca4d465cad65d6912e03 100644
--- a/ambient_light_sensor.h
+++ b/ambient_light_sensor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include <glib.h>
#include "power_manager/backlight_controller.h"
+#include "power_manager/signal_callback.h"
namespace power_manager {
@@ -47,8 +48,11 @@ class AmbientLightSensor {
void EnableOrDisableSensor(PowerState power, DimState dim);
private:
- static gboolean ReadAls(gpointer data);
- static bool DeferredInit(AmbientLightSensor* self);
+ // Handler for a periodic event that reads the ambient light sensor.
+ SIGNAL_CALLBACK_0(AmbientLightSensor, gboolean, ReadAls);
+
+ // Deferred init for the als in case the light sensor starts late.
+ bool DeferredInit();
// Return a luma level normalized to 100 based on the tsl2563 lux value.
// The luma level will modify the controller's brightness calculation.
« no previous file with comments | « no previous file | ambient_light_sensor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698