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

Unified Diff: base/power_monitor/power_observer.h

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use holder class for lazy initialization on Android Created 7 years, 9 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 | « base/power_monitor/power_monitor_win.cc ('k') | base/system_monitor/system_monitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/power_monitor/power_observer.h
diff --git a/base/time/default_clock.h b/base/power_monitor/power_observer.h
similarity index 27%
copy from base/time/default_clock.h
copy to base/power_monitor/power_observer.h
index 2022d5cdbab50f5651c8513ee4a6b8eda79f1426..6be70bba9d5368dfa0cf7a4f145247a1334430ec 100644
--- a/base/time/default_clock.h
+++ b/base/power_monitor/power_observer.h
@@ -1,25 +1,31 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_DEFAULT_CLOCK_H_
-#define BASE_DEFAULT_CLOCK_H_
+#ifndef BASE_POWER_MONITOR_POWER_OBSERVER_H_
+#define BASE_POWER_MONITOR_POWER_OBSERVER_H_
#include "base/base_export.h"
#include "base/compiler_specific.h"
-#include "base/time/clock.h"
namespace base {
-// DefaultClock is a Clock implementation that uses Time::Now().
-class BASE_EXPORT DefaultClock : public Clock {
+class BASE_EXPORT PowerObserver {
public:
- virtual ~DefaultClock();
+ // Notification of a change in power status of the computer, such
+ // as from switching between battery and A/C power.
+ virtual void OnPowerStateChange(bool on_battery_power) {};
- // Simply returns Time::Now().
- virtual Time Now() OVERRIDE;
+ // Notification that the system is suspending.
+ virtual void OnSuspend() {}
+
+ // Notification that the system is resuming.
+ virtual void OnResume() {}
+
+ protected:
+ virtual ~PowerObserver() {}
};
} // namespace base
-#endif // BASE_DEFAULT_CLOCK_H_
+#endif // BASE_POWER_MONITOR_POWER_OBSERVER_H_
« no previous file with comments | « base/power_monitor/power_monitor_win.cc ('k') | base/system_monitor/system_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698