Chromium Code Reviews| Index: content/browser/battery_status/battery_status_message_filter.h |
| diff --git a/content/browser/battery_status/battery_status_message_filter.h b/content/browser/battery_status/battery_status_message_filter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0dfddb56b1cc388cef3e0b6a295d39d873a9656b |
| --- /dev/null |
| +++ b/content/browser/battery_status/battery_status_message_filter.h |
| @@ -0,0 +1,38 @@ |
| +// 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 CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MESSAGE_FILTER_H_ |
| +#define CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MESSAGE_FILTER_H_ |
| + |
| +#include <list> |
| + |
| +#include "content/public/browser/battery_status_provider.h" |
| +#include "content/public/browser/browser_message_filter.h" |
| + |
| +class BatteryStatusMessageFilter : public content::BrowserMessageFilter { |
|
jam
2012/04/12 19:34:55
nit: for this class and the other new class, pleas
sadrul
2012/04/12 21:53:24
Done.
|
| + public: |
| + BatteryStatusMessageFilter(); |
| + |
| + void SendUpdates(const content::PowerSupplyStatus& power_status); |
| + |
| + private: |
| + virtual ~BatteryStatusMessageFilter(); |
| + |
| + void OnStartUpdating(int render_view_id); |
| + void OnStopUpdating(int render_view_id); |
| + |
| + // content::BrowserMessageFilter implementation. |
| + virtual bool OnMessageReceived(const IPC::Message& message, |
| + bool* message_was_ok) OVERRIDE; |
| + |
| + // The list of renderers that want battery status updates. |
|
jam
2012/04/12 19:34:55
nit: renderers-> RenderViews
sadrul
2012/04/12 21:53:24
Done.
|
| + std::list<int> notify_updates_; |
| + |
| + class PowerManagerObserver; |
| + scoped_ptr<PowerManagerObserver> observer_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BatteryStatusMessageFilter); |
| +}; |
| + |
| +#endif // CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MESSAGE_FILTER_H_ |