| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 {} | 78 virtual void Error() override {} |
| 79 virtual void Close(bool by_user) override {} | 79 virtual void Close(bool by_user) override {} |
| 80 virtual void Click() override {} | 80 virtual void Click() override {} |
| 81 virtual std::string id() const override { return id_; } | 81 virtual std::string id() const override { return id_; } |
| 82 // A NULL return value prevents loading image from URL. It is OK since our | |
| 83 // implementation loads image from system resource bundle. | |
| 84 virtual content::WebContents* GetWebContents() const override { | |
| 85 return NULL; | |
| 86 } | |
| 87 | 82 |
| 88 private: | 83 private: |
| 89 virtual ~PeripheralBatteryNotificationDelegate() {} | 84 virtual ~PeripheralBatteryNotificationDelegate() {} |
| 90 | 85 |
| 91 const std::string id_; | 86 const std::string id_; |
| 92 | 87 |
| 93 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryNotificationDelegate); | 88 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryNotificationDelegate); |
| 94 }; | 89 }; |
| 95 | 90 |
| 96 } // namespace | 91 } // namespace |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 235 |
| 241 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { | 236 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { |
| 242 // If last_used_profile_ is NULL then no notification has been posted yet. | 237 // If last_used_profile_ is NULL then no notification has been posted yet. |
| 243 if (notification_profile_) { | 238 if (notification_profile_) { |
| 244 g_browser_process->notification_ui_manager()->CancelById( | 239 g_browser_process->notification_ui_manager()->CancelById( |
| 245 address, NotificationUIManager::GetProfileID(notification_profile_)); | 240 address, NotificationUIManager::GetProfileID(notification_profile_)); |
| 246 } | 241 } |
| 247 } | 242 } |
| 248 | 243 |
| 249 } // namespace chromeos | 244 } // namespace chromeos |
| OLD | NEW |