OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" | 5 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
27 #include "ui/gfx/image/image.h" | 27 #include "ui/gfx/image/image.h" |
28 | 28 |
29 namespace chromeos { | 29 namespace chromeos { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 // When a peripheral device's battery level is <= kLowBatteryLevel, consider | 33 // When a peripheral device's battery level is <= kLowBatteryLevel, consider |
34 // it to be in low battery condition. | 34 // it to be in low battery condition. |
35 const int kLowBatteryLevel = 15; | 35 const int kLowBatteryLevel = 5; |
36 | 36 |
37 // Don't show 2 low battery notification within |kNotificationIntervalSec| | 37 // Don't show 2 low battery notification within |kNotificationIntervalSec| |
38 // seconds. | 38 // seconds. |
39 const int kNotificationIntervalSec = 60; | 39 const int kNotificationIntervalSec = 60; |
40 | 40 |
41 const char kNotificationOriginUrl[] = "chrome://peripheral-battery"; | 41 const char kNotificationOriginUrl[] = "chrome://peripheral-battery"; |
42 | 42 |
43 // HID Bluetooth device's battery sysfs entry path looks like | 43 // HID Bluetooth device's battery sysfs entry path looks like |
44 // "/sys/class/power_supply/hid-AA:BB:CC:DD:EE:FF-battery". | 44 // "/sys/class/power_supply/hid-AA:BB:CC:DD:EE:FF-battery". |
45 // Here the bluetooth address is showed in reverse order and its true | 45 // Here the bluetooth address is showed in reverse order and its true |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ProfileManager::GetDefaultProfileOrOffTheRecord()); | 230 ProfileManager::GetDefaultProfileOrOffTheRecord()); |
231 | 231 |
232 return true; | 232 return true; |
233 } | 233 } |
234 | 234 |
235 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { | 235 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { |
236 g_browser_process->notification_ui_manager()->CancelById(address); | 236 g_browser_process->notification_ui_manager()->CancelById(address); |
237 } | 237 } |
238 | 238 |
239 } // namespace chromeos | 239 } // namespace chromeos |
OLD | NEW |