Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_LINUX_H_ | |
| 5 #define CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_LINUX_H_ | |
| 6 | |
| 7 #include "content/browser/battery_status/battery_status_manager.h" | |
|
hashimoto
2014/08/11 08:19:15
nit: No need to include this.
timvolodine
2014/08/11 16:03:00
this is needed due to BatteryStatusManager::Create
hashimoto
2014/08/12 10:01:43
Should be included in battery_status_manager_linux
timvolodine
2014/08/12 19:27:53
Done. although it looks a bit weird to include two
| |
| 8 #include "content/common/content_export.h" | |
| 9 | |
| 10 namespace base { | |
| 11 class DictionaryValue; | |
| 12 } | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // UPowerDeviceState reflects the possible UPower.Device.State values, | |
| 17 // see upower.freedesktop.org/docs/Device.html#Device:State. | |
| 18 enum UPowerDeviceState { | |
| 19 UPOWER_DEVICE_STATE_UNKNOWN = 0, | |
| 20 UPOWER_DEVICE_STATE_CHARGING = 1, | |
| 21 UPOWER_DEVICE_STATE_DISCHARGING = 2, | |
| 22 UPOWER_DEVICE_STATE_EMPTY = 3, | |
| 23 UPOWER_DEVICE_STATE_FULL = 4, | |
| 24 UPOWER_DEVICE_STATE_PENDING_CHARGE = 5, | |
| 25 UPOWER_DEVICE_STATE_PENDING_DISCHARGE = 6, | |
| 26 }; | |
| 27 | |
| 28 // Computes and sets the WebBatteryStatus values where possible based on the | |
| 29 // provided dictionary. | |
| 30 CONTENT_EXPORT void ComputeWebBatteryStatus( | |
| 31 const base::DictionaryValue& dictionary, blink::WebBatteryStatus& status); | |
|
hashimoto
2014/08/11 08:19:16
Our style guide prohibits use of non-const referen
timvolodine
2014/08/11 16:03:00
Done. made it return a scoped_ptr.
hashimoto
2014/08/12 10:01:43
WebBatteryStatus is a copyable class.
Why does thi
timvolodine
2014/08/12 19:27:53
I was actually trying to avoid a copy, but the com
hashimoto
2014/08/13 11:02:20
Why do you care about a copy here when you allocat
timvolodine
2014/08/13 16:58:08
well, the empty dictionary is a special case (i.e.
| |
| 32 | |
| 33 } // namespace content | |
| 34 | |
| 35 #endif // CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_LINUX_H_ | |
| OLD | NEW |