| 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/ScriptPromiseProperty.h" | 9 #include "bindings/core/v8/ScriptPromiseProperty.h" |
| 10 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 ~BatteryManager() override; | 25 ~BatteryManager() override; |
| 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 const WTF::AtomicString& interfaceName() const override { return EventTarget
Names::BatteryManager; } | 31 const WTF::AtomicString& interfaceName() const override { return EventTarget
Names::BatteryManager; } |
| 32 ExecutionContext* executionContext() const override { return ContextLifecycl
eObserver::executionContext(); } | 32 ExecutionContext* getExecutionContext() const override { return ContextLifec
ycleObserver::getExecutionContext(); } |
| 33 | 33 |
| 34 bool charging(); | 34 bool charging(); |
| 35 double chargingTime(); | 35 double chargingTime(); |
| 36 double dischargingTime(); | 36 double dischargingTime(); |
| 37 double level(); | 37 double level(); |
| 38 | 38 |
| 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(chargingchange); | 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(chargingchange); |
| 40 DEFINE_ATTRIBUTE_EVENT_LISTENER(chargingtimechange); | 40 DEFINE_ATTRIBUTE_EVENT_LISTENER(chargingtimechange); |
| 41 DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange); | 41 DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange); |
| 42 DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange); | 42 DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 59 explicit BatteryManager(ExecutionContext*); | 59 explicit BatteryManager(ExecutionContext*); |
| 60 | 60 |
| 61 using BatteryProperty = ScriptPromiseProperty<Member<BatteryManager>, Member
<BatteryManager>, Member<DOMException>>; | 61 using BatteryProperty = ScriptPromiseProperty<Member<BatteryManager>, Member
<BatteryManager>, Member<DOMException>>; |
| 62 Member<BatteryProperty> m_batteryProperty; | 62 Member<BatteryProperty> m_batteryProperty; |
| 63 BatteryStatus m_batteryStatus; | 63 BatteryStatus m_batteryStatus; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| 67 | 67 |
| 68 #endif // BatteryManager_h | 68 #endif // BatteryManager_h |
| OLD | NEW |