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

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: build fixes. 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
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/power_manager_client.cc
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc
index 8b0adb8145da4cba16467c0e58a7b2bc6e76a0d6..f3df80190cad2cc3af54adbe60c0959a03ab9daa 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"
@@ -806,7 +807,15 @@ class PowerManagerClientStubImpl : public PowerManagerClient {
callback.Run(0);
}
- virtual void RequestIdleNotification(int64 threshold) OVERRIDE {}
+ virtual void RequestIdleNotification(int64 threshold) OVERRIDE {
+ 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(
@@ -869,6 +878,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_;
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698