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

Unified Diff: base/power_monitor/power_monitor_device_source.h

Issue 622693004: Make base::PowerMonitor work on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: base/power_monitor/power_monitor_device_source.h
diff --git a/base/power_monitor/power_monitor_device_source.h b/base/power_monitor/power_monitor_device_source.h
index 37b065a77c6a16498fc07993a7eb5b1276ad606a..d29ec0a499d81d0dc0a80af69b34a626edaa3563 100644
--- a/base/power_monitor/power_monitor_device_source.h
+++ b/base/power_monitor/power_monitor_device_source.h
@@ -51,6 +51,16 @@ class BASE_EXPORT PowerMonitorDeviceSource : public PowerMonitorSource {
#endif // OS_IOS
#endif // OS_MACOSX
+#if defined(OS_CHROMEOS)
+ // On Chrome OS, Chrome receives power-related events from powerd, the system
+ // power daemon, via D-Bus signals received on the UI thread. base can't
+ // directly depend on that code, so this class instead exposes static methods
+ // so that events can be passed in.
+ static void SetPowerSource(bool on_battery);
+ static void HandleSystemSuspending();
+ static void HandleSystemResumed();
+#endif
+
private:
#if defined(OS_WIN)
// Represents a message-only window for power message handling on Windows.

Powered by Google App Engine
This is Rietveld 408576698