OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/message_center/message_center.h" | 5 #include "ui/message_center/message_center.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (notification_list_->SetNotificationPrimaryIcon(id, image)) | 87 if (notification_list_->SetNotificationPrimaryIcon(id, image)) |
88 NotifyMessageCenterChanged(true); | 88 NotifyMessageCenterChanged(true); |
89 } | 89 } |
90 | 90 |
91 void MessageCenter::SetNotificationSecondaryIcon(const std::string& id, | 91 void MessageCenter::SetNotificationSecondaryIcon(const std::string& id, |
92 const gfx::ImageSkia& image) { | 92 const gfx::ImageSkia& image) { |
93 if (notification_list_->SetNotificationSecondaryIcon(id, image)) | 93 if (notification_list_->SetNotificationSecondaryIcon(id, image)) |
94 NotifyMessageCenterChanged(true); | 94 NotifyMessageCenterChanged(true); |
95 } | 95 } |
96 | 96 |
| 97 void MessageCenter::SetNotificationImage(const std::string& id, |
| 98 const gfx::ImageSkia& image) { |
| 99 if (notification_list_->SetNotificationImage(id, image)) |
| 100 NotifyMessageCenterChanged(true); |
| 101 } |
| 102 |
97 //------------------------------------------------------------------------------ | 103 //------------------------------------------------------------------------------ |
98 // Overridden from NotificationList::Delegate. | 104 // Overridden from NotificationList::Delegate. |
99 | 105 |
100 void MessageCenter::SendRemoveNotification(const std::string& id) { | 106 void MessageCenter::SendRemoveNotification(const std::string& id) { |
101 if (delegate_) | 107 if (delegate_) |
102 delegate_->NotificationRemoved(id); | 108 delegate_->NotificationRemoved(id); |
103 } | 109 } |
104 | 110 |
105 void MessageCenter::SendRemoveAllNotifications() { | 111 void MessageCenter::SendRemoveAllNotifications() { |
106 if (delegate_) { | 112 if (delegate_) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 174 } |
169 | 175 |
170 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { | 176 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { |
171 FOR_EACH_OBSERVER(Observer, | 177 FOR_EACH_OBSERVER(Observer, |
172 observer_list_, | 178 observer_list_, |
173 OnMessageCenterChanged(new_notification)); | 179 OnMessageCenterChanged(new_notification)); |
174 } | 180 } |
175 | 181 |
176 | 182 |
177 } // namespace message_center | 183 } // namespace message_center |
OLD | NEW |