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