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 #include "modules/battery/NavigatorBattery.h" | 5 #include "modules/battery/NavigatorBattery.h" |
6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromise.h" |
7 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
8 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
9 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
10 #include "core/frame/LocalDOMWindow.h" | 11 #include "core/frame/LocalDOMWindow.h" |
| 12 #include "core/frame/Navigator.h" |
11 #include "modules/battery/BatteryManager.h" | 13 #include "modules/battery/BatteryManager.h" |
| 14 #include "platform/bindings/ScriptState.h" |
12 | 15 |
13 namespace blink { | 16 namespace blink { |
14 | 17 |
15 NavigatorBattery::NavigatorBattery(Navigator& navigator) | 18 NavigatorBattery::NavigatorBattery(Navigator& navigator) |
16 : Supplement<Navigator>(navigator) {} | 19 : Supplement<Navigator>(navigator) {} |
17 | 20 |
18 ScriptPromise NavigatorBattery::getBattery(ScriptState* script_state, | 21 ScriptPromise NavigatorBattery::getBattery(ScriptState* script_state, |
19 Navigator& navigator) { | 22 Navigator& navigator) { |
20 return NavigatorBattery::From(navigator).getBattery(script_state); | 23 return NavigatorBattery::From(navigator).getBattery(script_state); |
21 } | 24 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 60 } |
58 return *supplement; | 61 return *supplement; |
59 } | 62 } |
60 | 63 |
61 DEFINE_TRACE(NavigatorBattery) { | 64 DEFINE_TRACE(NavigatorBattery) { |
62 visitor->Trace(battery_manager_); | 65 visitor->Trace(battery_manager_); |
63 Supplement<Navigator>::Trace(visitor); | 66 Supplement<Navigator>::Trace(visitor); |
64 } | 67 } |
65 | 68 |
66 } // namespace blink | 69 } // namespace blink |
OLD | NEW |