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

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

Issue 446603002: Refactor code listening to platform events in content/renderer/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webkitplatform_impl_start_stop
Patch Set: rebase Created 6 years, 4 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
index 0358fa792d2b097f4fe7a378b0ef010628bcde84..57255c0263d4a18608ba66bde3b9845c9c59d5c5 100644
--- a/content/renderer/battery_status/battery_status_dispatcher.h
+++ b/content/renderer/battery_status/battery_status_dispatcher.h
@@ -5,7 +5,7 @@
#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"
+#include "content/public/renderer/platform_event_observer.h"
namespace blink {
class WebBatteryStatus;
@@ -15,27 +15,25 @@ class WebBatteryStatusListener;
namespace content {
class RenderThread;
-class CONTENT_EXPORT BatteryStatusDispatcher : public RenderProcessObserver {
+class CONTENT_EXPORT BatteryStatusDispatcher
+ : NON_EXPORTED_BASE(
+ public PlatformEventObserver<blink::WebBatteryStatusListener>) {
public:
explicit BatteryStatusDispatcher(RenderThread* thread);
virtual ~BatteryStatusDispatcher();
- // RenderProcessObserver method.
+ // PlatformEventObserver public methods.
virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
-
- // Sets the listener to receive battery status updates. Returns true if the
- // registration was successful.
- bool SetListener(blink::WebBatteryStatusListener* listener);
+ virtual void SendFakeDataForTesting(void* data) OVERRIDE;
protected:
- virtual bool Start();
- virtual bool Stop();
+ // PlatformEventObserver protected methods.
+ virtual void SendStartMessage() OVERRIDE;
+ virtual void SendStopMessage() OVERRIDE;
private:
void OnDidChange(const blink::WebBatteryStatus& status);
- blink::WebBatteryStatusListener* listener_;
-
DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher);
};
« no previous file with comments | « content/public/test/layouttest_support.h ('k') | content/renderer/battery_status/battery_status_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698