root/Source/modules/battery/BatteryStatus.cpp

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. create
  2. create
  3. m_level
  4. m_level

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "config.h"
#include "modules/battery/BatteryStatus.h"

#include <limits>

namespace WebCore {

PassOwnPtr<BatteryStatus> BatteryStatus::create()
{
    return adoptPtr(new BatteryStatus);
}

PassOwnPtr<BatteryStatus> BatteryStatus::create(bool charging, double chargingTime, double dischargingTime, double level)
{
    return adoptPtr(new BatteryStatus(charging, chargingTime, dischargingTime, level));
}

BatteryStatus::BatteryStatus()
    : m_charging(true)
    , m_chargingTime(0)
    , m_dischargingTime(std::numeric_limits<double>::infinity())
    , m_level(1)
{
}

BatteryStatus::BatteryStatus(bool charging, double chargingTime, double dischargingTime, double level)
    : m_charging(charging)
    , m_chargingTime(chargingTime)
    , m_dischargingTime(dischargingTime)
    , m_level(level)
{
}

} // namespace WebCore


/* [<][>][^][v][top][bottom][index][help] */