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

Unified Diff: ui/message_center/message_center_impl.cc

Issue 14631005: Enable users of NotificationUIManager to specify binary images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for relanding. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/message_center_impl.h ('k') | ui/message_center/message_center_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center_impl.cc
diff --git a/ui/message_center/message_center_impl.cc b/ui/message_center/message_center_impl.cc
index 58aebbbfd3a5a0338da77de568d694346be0cae3..68780c5aee95733b35c46218b97070c7623ad631 100644
--- a/ui/message_center/message_center_impl.cc
+++ b/ui/message_center/message_center_impl.cc
@@ -80,46 +80,31 @@ NotificationList::PopupNotifications
//------------------------------------------------------------------------------
// Client code interface.
+void MessageCenterImpl::AddNotification(scoped_ptr<Notification> notification) {
+ DCHECK(notification.get());
-void MessageCenterImpl::AddNotification(
- NotificationType type,
- const std::string& id,
- const string16& title,
- const string16& message,
- const string16& display_source,
- const std::string& extension_id,
- const base::DictionaryValue* optional_fields,
- NotificationDelegate* delegate) {
// Sometimes the notification can be added with the same id and the
// |notification_list| will replace the notification instead of adding new.
// This is essentially an update rather than addition.
+ const std::string& id = notification->id();
bool already_exists = notification_list_->HasNotification(id);
- notification_list_->AddNotification(type,
- id,
- title,
- message,
- display_source,
- extension_id,
- optional_fields,
- delegate);
+ notification_list_->AddNotification(notification.Pass());
+
if (already_exists) {
- FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
- OnNotificationUpdated(id));
+ FOR_EACH_OBSERVER(
+ MessageCenterObserver, observer_list_, OnNotificationUpdated(id));
} else {
- FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
- OnNotificationAdded(id));
+ FOR_EACH_OBSERVER(
+ MessageCenterObserver, observer_list_, OnNotificationAdded(id));
}
}
void MessageCenterImpl::UpdateNotification(
const std::string& old_id,
- const std::string& new_id,
- const string16& title,
- const string16& message,
- const base::DictionaryValue* optional_fields,
- NotificationDelegate* delegate) {
- notification_list_->UpdateNotificationMessage(
- old_id, new_id, title, message, optional_fields, delegate);
+ scoped_ptr<Notification> new_notification) {
+ std::string new_id = new_notification->id();
+ notification_list_->UpdateNotificationMessage(old_id,
+ new_notification.Pass());
if (old_id == new_id) {
FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
OnNotificationUpdated(new_id));
« no previous file with comments | « ui/message_center/message_center_impl.h ('k') | ui/message_center/message_center_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698