| 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 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); | 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); |
| 22 public: | 23 public: |
| 23 virtual ~BatteryManager(); | 24 virtual ~BatteryManager(); |
| 24 static BatteryManager* create(ExecutionContext*); | 25 static BatteryManager* create(ExecutionContext*); |
| 25 | 26 |
| 26 // Returns a promise object that will be resolved with this BatteryManager. | 27 // Returns a promise object that will be resolved with this BatteryManager. |
| 27 ScriptPromise startRequest(ScriptState*); | 28 ScriptPromise startRequest(ScriptState*); |
| 28 | 29 |
| 29 // EventTarget implementation. | 30 // EventTarget implementation. |
| 30 virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return Eve
ntTargetNames::BatteryManager; } | 31 virtual const WTF::AtomicString& interfaceName() const OVERRIDE { return Eve
ntTargetNames::BatteryManager; } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 Resolved, | 63 Resolved, |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 explicit BatteryManager(ExecutionContext*); | 66 explicit BatteryManager(ExecutionContext*); |
| 66 | 67 |
| 67 RefPtr<ScriptPromiseResolver> m_resolver; | 68 RefPtr<ScriptPromiseResolver> m_resolver; |
| 68 Member<BatteryStatus> m_batteryStatus; | 69 Member<BatteryStatus> m_batteryStatus; |
| 69 State m_state; | 70 State m_state; |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } | 73 } // namespace blink |
| 73 | 74 |
| 74 #endif // BatteryManager_h | 75 #endif // BatteryManager_h |
| OLD | NEW |