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

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

Issue 457933002: Replace Chrome IPC with Mojo IPC for querying BatteryStatus service Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 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 57255c0263d4a18608ba66bde3b9845c9c59d5c5..edd11a12effc1db63622c94bd3eb6c5df842a232 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::BatteryMonitorClient) {
public:
- explicit BatteryStatusDispatcher(RenderThread* thread);
+ explicit BatteryStatusDispatcher(blink::WebBatteryStatusListener* listener);
virtual ~BatteryStatusDispatcher();
- // PlatformEventObserver public methods.
- virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
- virtual void SendFakeDataForTesting(void* data) OVERRIDE;
+ private:
+ // BatteryMonitorClient method.
+ virtual void DidChange(device::BatteryStatusPtr battery_status) OVERRIDE;
- protected:
- // PlatformEventObserver protected methods.
- virtual void SendStartMessage() OVERRIDE;
- virtual 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