Lines Matching refs:battery
33 // When a peripheral device's battery level is <= kLowBatteryLevel, consider
34 // it to be in low battery condition.
37 // Don't show 2 low battery notification within |kNotificationIntervalSec|
41 const char kNotificationOriginUrl[] = "chrome://peripheral-battery";
43 // HID Bluetooth device's battery sysfs entry path looks like
44 // "/sys/class/power_supply/hid-AA:BB:CC:DD:EE:FF-battery".
48 const char kHIDBatteryPathSuffix[] = "-battery";
124 LOG(ERROR) << "Unsupported battery path " << path;
129 LOG(ERROR) << "No valid battery address at path " << path;
134 LOG(ERROR) << "Invalid battery level " << level
138 // If unknown battery level received, cancel any existing notification.
145 // 1. It's the first time the battery level is received, and it is
147 // 2. The battery level is in record and it drops below kLowBatteryLevel.
149 BatteryInfo battery(name, level, base::TimeTicks());
151 if (PostNotification(address, battery))
152 battery.last_notification_timestamp = testing_clock_ ?
155 batteries_[address] = battery;
157 BatteryInfo* battery = &batteries_[address];
158 battery->name = name;
159 int old_level = battery->level;
160 battery->level = level;
162 if (PostNotification(address, *battery))
163 battery->last_notification_timestamp = testing_clock_ ?
200 const BatteryInfo& battery) {
202 // last notification showed, avoiding the case where the battery level
206 if (now - battery.last_notification_timestamp <
215 battery.level);
222 base::UTF8ToUTF16(battery.name),