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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 std::string address = JoinString(result, ':'); | 67 std::string address = JoinString(result, ':'); |
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 {} | |
78 virtual void Error() override {} | |
79 virtual void Close(bool by_user) override {} | |
80 virtual void Click() override {} | |
81 virtual std::string id() const override { return id_; } | 77 virtual std::string id() const override { return id_; } |
82 | 78 |
83 private: | 79 private: |
84 virtual ~PeripheralBatteryNotificationDelegate() {} | 80 virtual ~PeripheralBatteryNotificationDelegate() {} |
85 | 81 |
86 const std::string id_; | 82 const std::string id_; |
87 | 83 |
88 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryNotificationDelegate); | 84 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryNotificationDelegate); |
89 }; | 85 }; |
90 | 86 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 231 |
236 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { | 232 void PeripheralBatteryObserver::CancelNotification(const std::string& address) { |
237 // If last_used_profile_ is NULL then no notification has been posted yet. | 233 // If last_used_profile_ is NULL then no notification has been posted yet. |
238 if (notification_profile_) { | 234 if (notification_profile_) { |
239 g_browser_process->notification_ui_manager()->CancelById( | 235 g_browser_process->notification_ui_manager()->CancelById( |
240 address, NotificationUIManager::GetProfileID(notification_profile_)); | 236 address, NotificationUIManager::GetProfileID(notification_profile_)); |
241 } | 237 } |
242 } | 238 } |
243 | 239 |
244 } // namespace chromeos | 240 } // namespace chromeos |
OLD | NEW |