| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 IDS_ASH_LOW_PERIPHERAL_BATTERY_NOTIFICATION_TEXT, | 214 IDS_ASH_LOW_PERIPHERAL_BATTERY_NOTIFICATION_TEXT, |
| 215 battery.level); | 215 battery.level); |
| 216 | 216 |
| 217 Notification notification( | 217 Notification notification( |
| 218 // TODO(mukai): add SYSTEM priority and use here. | 218 // TODO(mukai): add SYSTEM priority and use here. |
| 219 GURL(kNotificationOriginUrl), | 219 GURL(kNotificationOriginUrl), |
| 220 ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 220 ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 221 IDR_NOTIFICATION_PERIPHERAL_BATTERY_LOW), | 221 IDR_NOTIFICATION_PERIPHERAL_BATTERY_LOW), |
| 222 UTF8ToUTF16(battery.name), | 222 UTF8ToUTF16(battery.name), |
| 223 string_text, | 223 string_text, |
| 224 WebKit::WebTextDirectionDefault, | 224 blink::WebTextDirectionDefault, |
| 225 string16(), | 225 string16(), |
| 226 UTF8ToUTF16(address), | 226 UTF8ToUTF16(address), |
| 227 new PeripheralBatteryNotificationDelegate(address)); | 227 new PeripheralBatteryNotificationDelegate(address)); |
| 228 | 228 |
| 229 notification_manager->Add(notification, | 229 notification_manager->Add(notification, |
| 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 |