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

Unified Diff: content/renderer/battery_status/battery_status_dispatcher.h

Issue 252113006: Add Battery Status API support in content/renderer and IPC messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix linkage issues with battery_status_dispatcher_unittest Created 6 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/battery_status_dispatcher.h
diff --git a/content/renderer/battery_status/battery_status_dispatcher.h b/content/renderer/battery_status/battery_status_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..6eecb5117604cc78863e717864f9cc81c67b3443
--- /dev/null
+++ b/content/renderer/battery_status/battery_status_dispatcher.h
@@ -0,0 +1,40 @@
+// 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_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_
+#define CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_
+
+#include "content/public/renderer/render_process_observer.h"
+
+namespace blink {
+class WebBatteryStatus;
+class WebBatteryStatusListener;
+}
+
+namespace content {
+class RenderThread;
+
+class CONTENT_EXPORT BatteryStatusDispatcher : public RenderProcessObserver {
+ public:
+ BatteryStatusDispatcher();
+ virtual ~BatteryStatusDispatcher();
+
+ void Attach(RenderThread* thread);
+ virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
jochen (gone - plz use gerrit) 2014/04/30 04:54:07 please group overrides and add a comment which int
timvolodine 2014/05/01 10:32:39 Done.
+
+ // Sets the listener to receive battery status updates. Returns true if the
+ // registration was successful.
+ bool SetListener(blink::WebBatteryStatusListener* listener);
+
+ private:
+ virtual bool Start();
jochen (gone - plz use gerrit) 2014/04/30 04:54:07 i guess your test needs to be a friend of this cla
timvolodine 2014/05/01 10:32:39 Done.
+ virtual bool Stop();
+ void OnDidChange(const blink::WebBatteryStatus& status);
+
+ blink::WebBatteryStatusListener* listener_;
+};
jochen (gone - plz use gerrit) 2014/04/30 04:54:07 disallow copy & assign
timvolodine 2014/05/01 10:32:39 Done.
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_

Powered by Google App Engine
This is Rietveld 408576698