| 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 RefCountedGarbageCollectedEventTargetWithInl
ineData<BatteryManager>, public ActiveDOMObject, public PlatformEventController
{ | 19 class BatteryManager final : public RefCountedGarbageCollectedEventTargetWithInl
ineData<BatteryManager>, public ActiveDOMObject, public PlatformEventController
{ |
| 20 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<B
atteryManager>); | 20 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BatteryManager); |
| 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 static BatteryManager* create(ExecutionContext*); |
| 25 virtual ~BatteryManager(); | 25 virtual ~BatteryManager(); |
| 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. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 explicit BatteryManager(ExecutionContext*); | 65 explicit BatteryManager(ExecutionContext*); |
| 66 | 66 |
| 67 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; | 67 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; |
| 68 Member<BatteryStatus> m_batteryStatus; | 68 Member<BatteryStatus> m_batteryStatus; |
| 69 State m_state; | 69 State m_state; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| 73 | 73 |
| 74 #endif // BatteryManager_h | 74 #endif // BatteryManager_h |
| OLD | NEW |