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

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

Issue 685703002: Reland "Replace Chrome IPC with Mojo IPC for querying BatteryStatus service" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Tim's comments. 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 61af8c3d7ce2bb67e1b227d61fb8aaaacf3b3dc5..9843246874f13489d1253d14b59b82ec283a00e3 100644
--- a/content/renderer/battery_status/battery_status_dispatcher.h
+++ b/content/renderer/battery_status/battery_status_dispatcher.h
@@ -5,34 +5,31 @@
#ifndef CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_
#define CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_
-#include "content/public/renderer/platform_event_observer.h"
+#include "base/macros.h"
+#include "content/common/content_export.h"
+#include "device/battery/battery_monitor.mojom.h"
namespace blink {
-class WebBatteryStatus;
class WebBatteryStatusListener;
}
namespace content {
-class RenderThread;
class CONTENT_EXPORT BatteryStatusDispatcher
- : NON_EXPORTED_BASE(
- public PlatformEventObserver<blink::WebBatteryStatusListener>) {
+ : public NON_EXPORTED_BASE(device::BatteryStatusObserver) {
public:
- explicit BatteryStatusDispatcher(RenderThread* thread);
+ explicit BatteryStatusDispatcher(blink::WebBatteryStatusListener* listener);
~BatteryStatusDispatcher() override;
- // PlatformEventObserver public methods.
- bool OnControlMessageReceived(const IPC::Message& message) override;
- void SendFakeDataForTesting(void* data) override;
+ private:
+ // BatteryStatusObserver method.
+ void DidChange(device::BatteryStatusPtr battery_status) override;
- protected:
- // PlatformEventObserver protected methods.
- void SendStartMessage() override;
- void SendStopMessage() override;
+ void Start();
+ void Stop();
- private:
- void OnDidChange(const blink::WebBatteryStatus& status);
+ device::BatteryMonitorPtr monitor_;
+ blink::WebBatteryStatusListener* listener_;
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