| Index: base/power_monitor/power_observer.h
|
| diff --git a/base/power_monitor/power_observer.h b/base/power_monitor/power_observer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a94aba659ea5b69d2197d543446ff0c7ba6d90a2
|
| --- /dev/null
|
| +++ b/base/power_monitor/power_observer.h
|
| @@ -0,0 +1,36 @@
|
| +// Copyright (c) 2012 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_POWER_MONITOR_POWER_OBSERVER_H_
|
| +#define BASE_POWER_MONITOR_POWER_OBSERVER_H_
|
| +
|
| +#include "base/base_export.h"
|
| +#include "base/compiler_specific.h"
|
| +
|
| +namespace base {
|
| +
|
| +// Callbacks will be called on the thread which creates the PowerMonitor.
|
| +// During the callback, Add/RemoveObserver will block until the callbacks
|
| +// are finished. Observers should implement quick callback functions; if
|
| +// lengthy operations are needed, the observer should take care to invoke
|
| +// the operation on an appropriate thread.
|
| +class BASE_EXPORT PowerObserver {
|
| + public:
|
| + // 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) {};
|
| +
|
| + // 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_POWER_MONITOR_POWER_OBSERVER_H_
|
|
|