Chromium Code Reviews| Index: content/browser/power_monitor_message_broadcaster.h |
| diff --git a/content/browser/power_monitor_message_broadcaster.h b/content/browser/power_monitor_message_broadcaster.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c8ba9adc499f31af1c604fb08bb36d1874215266 |
| --- /dev/null |
| +++ b/content/browser/power_monitor_message_broadcaster.h |
| @@ -0,0 +1,44 @@ |
| +// 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 CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_ |
| +#define CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/power_monitor/power_observer.h" |
| +#include "content/common/content_export.h" |
| +#include "content/public/browser/browser_message_filter.h" |
| +#include "content/public/browser/browser_thread.h" |
| + |
| + |
| +namespace IPC { |
| + class Sender; |
|
jam
2013/07/30 23:52:00
nit: no need, since you're including browser_messa
|
| +} |
| + |
| +namespace content { |
| + |
| +// A class used to monitor the power state change and communicate it to child |
| +// processes via IPC. All interaction with this class must be done on the UI |
| +// thread. |
|
jam
2013/07/30 23:52:00
when you say all interactions, do you mean also co
|
| +class CONTENT_EXPORT PowerMonitorMessageBroadcaster |
| + : public base::PowerObserver { |
| +public: |
|
jam
2013/07/30 23:52:00
nit: here and below, space before public
|
| + explicit PowerMonitorMessageBroadcaster(IPC::Sender* sender); |
| + virtual ~PowerMonitorMessageBroadcaster(); |
| + |
| + // Implement PowerObserver. |
| + virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE; |
| + virtual void OnSuspend() OVERRIDE; |
| + virtual void OnResume() OVERRIDE; |
| + |
| +private: |
| + IPC::Sender* sender_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PowerMonitorMessageBroadcaster); |
| +}; |
| + |
| +} // namespace base |
| + |
| +#endif // CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_ |