Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / base / power_monitor / power_monitor_device_source.h
index 37b065a..29f17c2 100644 (file)
@@ -37,7 +37,7 @@ namespace base {
 class BASE_EXPORT PowerMonitorDeviceSource : public PowerMonitorSource {
  public:
   PowerMonitorDeviceSource();
-  virtual ~PowerMonitorDeviceSource();
+  ~PowerMonitorDeviceSource() override;
 
 #if defined(OS_MACOSX)
   // Allocate system resources needed by the PowerMonitor class.
@@ -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.
@@ -80,7 +90,7 @@ class BASE_EXPORT PowerMonitorDeviceSource : public PowerMonitorSource {
   // Platform-specific method to check whether the system is currently
   // running on battery power.  Returns true if running on batteries,
   // false otherwise.
-  virtual bool IsOnBatteryPowerImpl() OVERRIDE;
+  bool IsOnBatteryPowerImpl() override;
 
   // Checks the battery status and notifies observers if the battery
   // status has changed.