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.
5 #ifndef BatteryStatus_h
6 #define BatteryStatus_h
8 #include "platform/heap/Handle.h"
9 #include "wtf/Forward.h"
10 #include "wtf/RefCounted.h"
14 class BatteryStatus final : public GarbageCollected<BatteryStatus> {
16 static BatteryStatus* create();
17 static BatteryStatus* create(bool charging, double chargingTime, double dischargingTime, double level);
19 bool charging() const { return m_charging; }
20 double chargingTime() const { return m_chargingTime; }
21 double dischargingTime() const { return m_dischargingTime; }
22 double level() const { return m_level; }
24 void trace(Visitor*) { }
28 BatteryStatus(bool charging, double chargingTime, double dischargingTime, double level);
31 double m_chargingTime;
32 double m_dischargingTime;
38 #endif // BatteryStatus_h