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

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

Issue 315023006: Revert of Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 984abcfc67510d2ea4a0ddf75e26159c29b5d9cf..875f9c9db9a23db028c6c283c900af5490444342 100644
--- a/Source/modules/battery/BatteryManager.h
+++ b/Source/modules/battery/BatteryManager.h
@@ -7,16 +7,15 @@
#include "core/dom/ContextLifecycleObserver.h"
#include "core/dom/Document.h"
-#include "core/frame/DeviceEventControllerBase.h"
+#include "core/frame/DeviceSensorEventController.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 DeviceEventControllerBase, public EventTargetWithInlineData {
+class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<BatteryManager>, public ActiveDOMObject, public DeviceSensorEventController, public EventTargetWithInlineData {
REFCOUNTED_EVENT_TARGET(BatteryManager);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager);
public:
@@ -37,11 +36,7 @@
DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange);
DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange);
- // Inherited from DeviceEventControllerBase.
- virtual void didUpdateData() OVERRIDE;
- virtual void registerWithDispatcher() OVERRIDE;
- virtual void unregisterWithDispatcher() OVERRIDE;
- virtual bool hasLastData() OVERRIDE;
+ void didChangeBatteryStatus(PassRefPtrWillBeRawPtr<Event>);
// ActiveDOMObject implementation.
virtual bool canSuspend() const { return true; }
@@ -49,10 +44,16 @@
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