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

Unified Diff: content/renderer/battery_status_dispatcher.h

Issue 10024013: chromeos: Add support for the battery status API on chromeos. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: file-move Created 8 years, 8 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/renderer/battery_status_dispatcher.h
diff --git a/content/renderer/battery_status_dispatcher.h b/content/renderer/battery_status_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..066d25c184fa1d13a80db2dea08ce896e17a7d4b
--- /dev/null
+++ b/content/renderer/battery_status_dispatcher.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_RENDERER_BATTERY_STATUS_DISPATCHER_H_
+#define CONTENT_RENDERER_BATTERY_STATUS_DISPATCHER_H_
+
+#include "content/public/renderer/render_view_observer.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebBatteryStatusClient.h"
+
+namespace WebKit {
+class WebBatteryStatus;
+}
+
+class RenderViewImpl;
+
+class BatteryStatusDispatcher : public content::RenderViewObserver,
+ public WebKit::WebBatteryStatusClient {
+ public:
+ explicit BatteryStatusDispatcher(RenderViewImpl* render_view);
+ virtual ~BatteryStatusDispatcher();
+
+ private:
+ void OnBatteryStatusUpdated(const IPC::Message& message);
+
+ // RenderView::Observer implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // WebKit::WebBatteryStatusClient implementation.
+ virtual void startUpdating();
+ virtual void stopUpdating();
+
+ bool started_;
+
+ DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher);
+};
+
+#endif // CONTENT_RENDERER_BATTERY_STATUS_DISPATCHER_H_

Powered by Google App Engine
This is Rietveld 408576698