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

Unified Diff: Source/modules/battery/BatteryManager.h

Issue 315573002: Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add stopUpdating in destructor of BatteryManager. Created 6 years, 6 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 | « Source/modules/battery/BatteryDispatcher.cpp ('k') | Source/modules/battery/BatteryManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/battery/BatteryManager.h
diff --git a/Source/modules/battery/BatteryManager.h b/Source/modules/battery/BatteryManager.h
index 875f9c9db9a23db028c6c283c900af5490444342..984abcfc67510d2ea4a0ddf75e26159c29b5d9cf 100644
--- a/Source/modules/battery/BatteryManager.h
+++ b/Source/modules/battery/BatteryManager.h
@@ -7,15 +7,16 @@
#include "core/dom/ContextLifecycleObserver.h"
#include "core/dom/Document.h"
-#include "core/frame/DeviceSensorEventController.h"
+#include "core/frame/DeviceEventControllerBase.h"
#include "modules/EventTargetModules.h"
#include "platform/heap/Handle.h"
namespace WebCore {
+class BatteryStatus;
class Navigator;
-class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<BatteryManager>, public ActiveDOMObject, public DeviceSensorEventController, public EventTargetWithInlineData {
+class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<BatteryManager>, public ActiveDOMObject, public DeviceEventControllerBase, public EventTargetWithInlineData {
REFCOUNTED_EVENT_TARGET(BatteryManager);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager);
public:
@@ -36,7 +37,11 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange);
DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange);
- void didChangeBatteryStatus(PassRefPtrWillBeRawPtr<Event>);
+ // Inherited from DeviceEventControllerBase.
+ virtual void didUpdateData() OVERRIDE;
+ virtual void registerWithDispatcher() OVERRIDE;
+ virtual void unregisterWithDispatcher() OVERRIDE;
+ virtual bool hasLastData() OVERRIDE;
// ActiveDOMObject implementation.
virtual bool canSuspend() const { return true; }
@@ -44,16 +49,10 @@ public:
virtual void resume() OVERRIDE;
virtual void stop() OVERRIDE;
- // DeviceSensorEventController
- virtual void registerWithDispatcher() OVERRIDE;
- virtual void unregisterWithDispatcher() OVERRIDE;
- virtual bool hasLastData() OVERRIDE;
- virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE;
- virtual bool isNullEvent(Event*) OVERRIDE;
- virtual Document* document() OVERRIDE;
-
private:
explicit BatteryManager(ExecutionContext*);
+
+ RefPtr<BatteryStatus> m_batteryStatus;
};
}
« no previous file with comments | « Source/modules/battery/BatteryDispatcher.cpp ('k') | Source/modules/battery/BatteryManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698