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

Unified Diff: chromeos/dbus/power_manager_client.cc

Issue 12093058: Screensaver implementation for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests. Created 7 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
Index: chromeos/dbus/power_manager_client.cc
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc
index 0dfa12b4e8d4b3076cd25e3a8aef93e4e1274252..811974410823ab3b64b40275ba83aa60f7252263 100644
--- a/chromeos/dbus/power_manager_client.cc
+++ b/chromeos/dbus/power_manager_client.cc
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/format_macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/message_loop.h"
#include "base/observer_list.h"
#include "base/stringprintf.h"
#include "base/threading/platform_thread.h"
@@ -800,7 +801,15 @@ class PowerManagerClientStubImpl : public PowerManagerClient {
callback.Run(0);
}
- virtual void RequestIdleNotification(int64 threshold) OVERRIDE {}
+ virtual void RequestIdleNotification(int64 threshold) OVERRIDE {
Matt Perry 2013/01/31 00:37:23 When is this called? I know it's a stub, but it'll
rkc 2013/01/31 02:15:46 This will only get called when running ChromeOS_Ch
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&PowerManagerClientStubImpl::TriggerIdleNotify,
+ base::Unretained(this),
+ threshold),
+ base::TimeDelta::FromMilliseconds(threshold));
+ }
+
virtual void NotifyUserActivity(
const base::TimeTicks& last_activity_time) OVERRIDE {}
virtual void NotifyVideoActivity(
@@ -863,6 +872,10 @@ class PowerManagerClientStubImpl : public PowerManagerClient {
BrightnessChanged(brightness_level, user_initiated));
}
+ void TriggerIdleNotify(int64 threshold) {
+ FOR_EACH_OBSERVER(Observer, observers_, IdleNotify(threshold));
+ }
+
bool discharging_;
int battery_percentage_;
double brightness_;
« chrome/test/data/extensions/screensaver_test_extension.pem ('K') | « chromeos/chromeos_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698