| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BatteryManager_h | 5 #ifndef BatteryManager_h |
| 6 #define BatteryManager_h | 6 #define BatteryManager_h |
| 7 | 7 |
| 8 #include "core/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/DeviceSensorEventController.h" | 10 #include "core/frame/DeviceSensorEventController.h" |
| 11 #include "modules/EventTargetModules.h" | 11 #include "modules/EventTargetModules.h" |
| 12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 13 | 13 |
| 14 namespace WebCore { | 14 namespace WebCore { |
| 15 | 15 |
| 16 class Navigator; | 16 class Navigator; |
| 17 | 17 |
| 18 class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<B
atteryManager>, public ActiveDOMObject, public DeviceSensorEventController, publ
ic EventTargetWithInlineData { | 18 class BatteryManager FINAL : public RefCountedWillBeRefCountedGarbageCollected<B
atteryManager>, public ActiveDOMObject, public DeviceSensorEventController, publ
ic EventTargetWithInlineData { |
| 19 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<B
atteryManager>); | 19 REFCOUNTED_EVENT_TARGET(BatteryManager); |
| 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); |
| 20 public: | 21 public: |
| 21 virtual ~BatteryManager(); | 22 virtual ~BatteryManager(); |
| 22 static PassRefPtrWillBeRawPtr<BatteryManager> create(ExecutionContext*); | 23 static PassRefPtrWillBeRawPtr<BatteryManager> create(ExecutionContext*); |
| 23 | 24 |
| 24 // EventTarget implementation. | 25 // EventTarget implementation. |
| 25 virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return Eve
ntTargetNames::BatteryManager; } | 26 virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return Eve
ntTargetNames::BatteryManager; } |
| 26 virtual ExecutionContext* executionContext() const OVERRIDE { return Context
LifecycleObserver::executionContext(); } | 27 virtual ExecutionContext* executionContext() const OVERRIDE { return Context
LifecycleObserver::executionContext(); } |
| 27 | 28 |
| 28 bool charging(); | 29 bool charging(); |
| 29 double chargingTime(); | 30 double chargingTime(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 virtual void stop() OVERRIDE; | 45 virtual void stop() OVERRIDE; |
| 45 | 46 |
| 46 // DeviceSensorEventController | 47 // DeviceSensorEventController |
| 47 virtual void registerWithDispatcher() OVERRIDE; | 48 virtual void registerWithDispatcher() OVERRIDE; |
| 48 virtual void unregisterWithDispatcher() OVERRIDE; | 49 virtual void unregisterWithDispatcher() OVERRIDE; |
| 49 virtual bool hasLastData() OVERRIDE; | 50 virtual bool hasLastData() OVERRIDE; |
| 50 virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE; | 51 virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE; |
| 51 virtual bool isNullEvent(Event*) OVERRIDE; | 52 virtual bool isNullEvent(Event*) OVERRIDE; |
| 52 virtual Document* document() OVERRIDE; | 53 virtual Document* document() OVERRIDE; |
| 53 | 54 |
| 54 void trace(Visitor*) { } | |
| 55 | |
| 56 private: | 55 private: |
| 57 explicit BatteryManager(ExecutionContext*); | 56 explicit BatteryManager(ExecutionContext*); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 } | 59 } |
| 61 | 60 |
| 62 #endif // BatteryManager_h | 61 #endif // BatteryManager_h |
| 63 | 62 |
| OLD | NEW |