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

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

Issue 676953005: Revert of Replace Chrome IPC with Mojo IPC for querying BatteryStatus service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « content/renderer/DEPS ('k') | content/renderer/battery_status/battery_status_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index 9843246874f13489d1253d14b59b82ec283a00e3..61af8c3d7ce2bb67e1b227d61fb8aaaacf3b3dc5 100644
--- a/content/renderer/battery_status/battery_status_dispatcher.h
+++ b/content/renderer/battery_status/battery_status_dispatcher.h
@@ -5,31 +5,34 @@
#ifndef CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_
#define CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_
-#include "base/macros.h"
-#include "content/common/content_export.h"
-#include "device/battery/battery_monitor.mojom.h"
+#include "content/public/renderer/platform_event_observer.h"
namespace blink {
+class WebBatteryStatus;
class WebBatteryStatusListener;
}
namespace content {
+class RenderThread;
class CONTENT_EXPORT BatteryStatusDispatcher
- : public NON_EXPORTED_BASE(device::BatteryStatusObserver) {
+ : NON_EXPORTED_BASE(
+ public PlatformEventObserver<blink::WebBatteryStatusListener>) {
public:
- explicit BatteryStatusDispatcher(blink::WebBatteryStatusListener* listener);
+ explicit BatteryStatusDispatcher(RenderThread* thread);
~BatteryStatusDispatcher() override;
+ // PlatformEventObserver public methods.
+ bool OnControlMessageReceived(const IPC::Message& message) override;
+ void SendFakeDataForTesting(void* data) override;
+
+ protected:
+ // PlatformEventObserver protected methods.
+ void SendStartMessage() override;
+ void SendStopMessage() override;
+
private:
- // BatteryStatusObserver method.
- void DidChange(device::BatteryStatusPtr battery_status) override;
-
- void Start();
- void Stop();
-
- device::BatteryMonitorPtr monitor_;
- blink::WebBatteryStatusListener* listener_;
+ void OnDidChange(const blink::WebBatteryStatus& status);
DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher);
};
« no previous file with comments | « content/renderer/DEPS ('k') | content/renderer/battery_status/battery_status_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698