| 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 "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
| 11 #include "core/frame/PlatformEventController.h" | 11 #include "core/frame/PlatformEventController.h" |
| 12 #include "modules/EventTargetModules.h" | 12 #include "modules/EventTargetModules.h" |
| 13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class BatteryStatus; | 17 class BatteryStatus; |
| 18 | 18 |
| 19 class BatteryManager FINAL : public RefCountedGarbageCollectedWillBeGarbageColle
ctedFinalized<BatteryManager>, public ActiveDOMObject, public PlatformEventContr
oller, public EventTargetWithInlineData { | 19 class BatteryManager FINAL : public RefCountedGarbageCollectedWillBeGarbageColle
ctedFinalized<BatteryManager>, public ActiveDOMObject, public PlatformEventContr
oller, public EventTargetWithInlineData { |
| 20 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<B
atteryManager>); | 20 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<B
atteryManager>); |
| 21 DEFINE_WRAPPERTYPEINFO(); | 21 DEFINE_WRAPPERTYPEINFO(); |
| 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); | 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); |
| 23 public: | 23 public: |
| 24 static BatteryManager* create(ExecutionContext*); |
| 24 virtual ~BatteryManager(); | 25 virtual ~BatteryManager(); |
| 25 static BatteryManager* create(ExecutionContext*); | |
| 26 | 26 |
| 27 // Returns a promise object that will be resolved with this BatteryManager. | 27 // Returns a promise object that will be resolved with this BatteryManager. |
| 28 ScriptPromise startRequest(ScriptState*); | 28 ScriptPromise startRequest(ScriptState*); |
| 29 | 29 |
| 30 // EventTarget implementation. | 30 // EventTarget implementation. |
| 31 virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return Eve
ntTargetNames::BatteryManager; } | 31 virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return Eve
ntTargetNames::BatteryManager; } |
| 32 virtual ExecutionContext* executionContext() const OVERRIDE { return Context
LifecycleObserver::executionContext(); } | 32 virtual ExecutionContext* executionContext() const OVERRIDE { return Context
LifecycleObserver::executionContext(); } |
| 33 | 33 |
| 34 bool charging(); | 34 bool charging(); |
| 35 double chargingTime(); | 35 double chargingTime(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 66 explicit BatteryManager(ExecutionContext*); | 66 explicit BatteryManager(ExecutionContext*); |
| 67 | 67 |
| 68 RefPtr<ScriptPromiseResolver> m_resolver; | 68 RefPtr<ScriptPromiseResolver> m_resolver; |
| 69 Member<BatteryStatus> m_batteryStatus; | 69 Member<BatteryStatus> m_batteryStatus; |
| 70 State m_state; | 70 State m_state; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace blink | 73 } // namespace blink |
| 74 | 74 |
| 75 #endif // BatteryManager_h | 75 #endif // BatteryManager_h |
| OLD | NEW |