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

Unified Diff: content/browser/battery_status/battery_status_message_filter.h

Issue 278043002: Battery Status API: browser-side implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 7 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
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..9c7b9db5be595889e2cf39155e4b285289db2df7
--- /dev/null
+++ b/content/browser/battery_status/battery_status_message_filter.h
@@ -0,0 +1,38 @@
+// Copyright 2014 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 "content/browser/battery_status/battery_status_update_callback.h"
+#include "content/public/browser/browser_message_filter.h"
+
+namespace content {
+
+class RenderProcessHost;
+
+class BatteryStatusMessageFilter : public BrowserMessageFilter {
+ public:
+ BatteryStatusMessageFilter();
+
+ // BrowserMessageFilter implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message,
+ bool* message_was_ok) OVERRIDE;
+
+ private:
+ virtual ~BatteryStatusMessageFilter();
+
+ void OnBatteryStatusStart();
+ void OnBatteryStatusStop();
+ void SendBatteryChange(const blink::WebBatteryStatus& status);
Michael van Ouwerkerk 2014/05/19 11:19:22 Nit: add an include for WebBatteryStatus?
timvolodine 2014/05/22 10:02:33 Done.
+
+ bool is_started_;
+ BatteryStatusUpdateCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(BatteryStatusMessageFilter);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698