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

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

Issue 212643010: Add Dispatcher class to the Battery Status API module. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove comments and stopUpdating in the destructor. Created 6 years, 8 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 fa7e8dc54abcb9980f011b5b8f3016f0aac1c2c2..ef21598bf017b9d6e6c9aaa9007cae7880531997 100644
--- a/Source/modules/battery/BatteryManager.h
+++ b/Source/modules/battery/BatteryManager.h
@@ -8,14 +8,14 @@
#include "core/dom/ContextLifecycleObserver.h"
#include "core/dom/Document.h"
#include "core/events/EventTarget.h"
+#include "core/frame/DeviceSensorEventController.h"
#include "heap/Handle.h"
-#include "modules/battery/BatteryStatus.h"
namespace WebCore {
class Navigator;
-class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<BatteryManager>, public ContextLifecycleObserver, public EventTargetWithInlineData {
+class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<BatteryManager>, public ActiveDOMObject, public DeviceSensorEventController, public EventTargetWithInlineData {
DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<BatteryManager>);
public:
virtual ~BatteryManager();
@@ -35,14 +35,25 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange);
DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange);
- void didChangeBatteryStatus(PassRefPtrWillBeRawPtr<Event>, PassOwnPtr<BatteryStatus>);
+ void didChangeBatteryStatus(PassRefPtrWillBeRawPtr<Event>);
+
+ // ActiveDOMObject implementation.
+ virtual bool canSuspend() const { return true; }
+ virtual void suspend() OVERRIDE;
+ 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;
void trace(Visitor*) { }
private:
explicit BatteryManager(ExecutionContext*);
-
- OwnPtr<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