Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: ui/message_center/message_center.cc

Issue 11639041: Added support for image notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bug detected by try bots. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/message_center/message_center.h ('k') | ui/message_center/message_center_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/message_center/message_center.h ('k') | ui/message_center/message_center_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698