summaryrefslogtreecommitdiffstats
path: root/device/battery/battery_status_manager_linux.h
blob: 7b71a04dc458c7b1b0f6f840c76e36c5d8dfb5aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// 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.
#ifndef DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_
#define DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_

#include "device/battery/battery_export.h"
#include "device/battery/battery_status.mojom.h"

namespace base {
class DictionaryValue;
}

namespace device {

// UPowerDeviceState reflects the possible UPower.Device.State values,
// see upower.freedesktop.org/docs/Device.html#Device:State.
enum UPowerDeviceState {
  UPOWER_DEVICE_STATE_UNKNOWN = 0,
  UPOWER_DEVICE_STATE_CHARGING = 1,
  UPOWER_DEVICE_STATE_DISCHARGING = 2,
  UPOWER_DEVICE_STATE_EMPTY = 3,
  UPOWER_DEVICE_STATE_FULL = 4,
  UPOWER_DEVICE_STATE_PENDING_CHARGE = 5,
  UPOWER_DEVICE_STATE_PENDING_DISCHARGE = 6,
};

// Returns the BatteryStatus computed using the provided dictionary.
DEVICE_BATTERY_EXPORT BatteryStatus ComputeWebBatteryStatus(
    const base::DictionaryValue& dictionary);

}  // namespace device

#endif  // DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_