OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "modules/battery/BatteryStatus.h" |
| 6 |
| 7 #include <limits> |
| 8 |
| 9 namespace blink { |
| 10 |
| 11 BatteryStatus* BatteryStatus::create() |
| 12 { |
| 13 return new BatteryStatus; |
| 14 } |
| 15 |
| 16 BatteryStatus* BatteryStatus::create(bool charging, double chargingTime, double
dischargingTime, double level) |
| 17 { |
| 18 return new BatteryStatus(charging, chargingTime, dischargingTime, level); |
| 19 } |
| 20 |
| 21 BatteryStatus::BatteryStatus() |
| 22 : m_charging(true) |
| 23 , m_chargingTime(0) |
| 24 , m_dischargingTime(std::numeric_limits<double>::infinity()) |
| 25 , m_level(1) |
| 26 { |
| 27 } |
| 28 |
| 29 BatteryStatus::BatteryStatus(bool charging, double chargingTime, double discharg
ingTime, double level) |
| 30 : m_charging(charging) |
| 31 , m_chargingTime(chargingTime) |
| 32 , m_dischargingTime(dischargingTime) |
| 33 , m_level(level) |
| 34 { |
| 35 } |
| 36 |
| 37 } // namespace blink |
OLD | NEW |