| 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 "ash/strings/grit/ash_strings.h" | 10 #include "ash/strings/grit/ash_strings.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 return address; | 68 return address; |
| 69 } | 69 } |
| 70 | 70 |
| 71 class PeripheralBatteryNotificationDelegate : public NotificationDelegate { | 71 class PeripheralBatteryNotificationDelegate : public NotificationDelegate { |
| 72 public: | 72 public: |
| 73 explicit PeripheralBatteryNotificationDelegate(const std::string& id) | 73 explicit PeripheralBatteryNotificationDelegate(const std::string& id) |
| 74 : id_(id) {} | 74 : id_(id) {} |
| 75 | 75 |
| 76 // Overridden from NotificationDelegate: | 76 // Overridden from NotificationDelegate: |
| 77 virtual void Display() override {} | 77 virtual void Display() override {} |
| 78 virtual void Error() override {} | |
| 79 virtual void Close(bool by_user) override {} | 78 virtual void Close(bool by_user) override {} |
| 80 virtual void Click() override {} | 79 virtual void Click() override {} |
| 81 virtual std::string id() const override { return id_; } | 80 virtual std::string id() const override { return id_; } |
| 82 | 81 |
| 83 private: | 82 private: |
| 84 virtual ~PeripheralBatteryNotificationDelegate() {} | 83 virtual ~PeripheralBatteryNotificationDelegate() {} |
| 85 | 84 |
| 86 const std::string id_; | 85 const std::string id_; |
| 87 | 86 |
| 88 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryNotificationDelegate); | 87 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryNotificationDelegate); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 234 |
| 236 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { | 235 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { |
| 237 // If last_used_profile_ is NULL then no notification has been posted yet. | 236 // If last_used_profile_ is NULL then no notification has been posted yet. |
| 238 if (notification_profile_) { | 237 if (notification_profile_) { |
| 239 g_browser_process->notification_ui_manager()->CancelById( | 238 g_browser_process->notification_ui_manager()->CancelById( |
| 240 address, NotificationUIManager::GetProfileID(notification_profile_)); | 239 address, NotificationUIManager::GetProfileID(notification_profile_)); |
| 241 } | 240 } |
| 242 } | 241 } |
| 243 | 242 |
| 244 } // namespace chromeos | 243 } // namespace chromeos |
| OLD | NEW |