summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/message_center_notification_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/notifications/message_center_notification_manager.cc')
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index b26157c..f400bfd 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -112,9 +112,6 @@ void MessageCenterNotificationManager::Add(const Notification& notification,
DesktopNotificationServiceFactory::GetForProfile(profile)->
ShowWelcomeNotificationIfNecessary(notification);
- // WARNING: You MUST use AddProfileNotification or update the message center
- // via the notification within a ProfileNotification object or the profile ID
- // will not be correctly set for ChromeOS.
AddProfileNotification(
new ProfileNotification(profile, notification, message_center_));
}
@@ -141,6 +138,7 @@ bool MessageCenterNotificationManager::Update(const Notification& notification,
// the immediate update allowed in the message center.
std::string old_id =
old_notification->notification().delegate_id();
+ DCHECK(message_center_->FindVisibleNotificationById(old_id));
// Add/remove notification in the local list but just update the same
// one in MessageCenter.
@@ -150,13 +148,11 @@ bool MessageCenterNotificationManager::Update(const Notification& notification,
new ProfileNotification(profile, notification, message_center_);
profile_notifications_[notification.delegate_id()] = new_notification;
- // WARNING: You MUST use AddProfileNotification or update the message
- // center via the notification within a ProfileNotification object or the
- // profile ID will not be correctly set for ChromeOS.
- message_center_->UpdateNotification(
- old_id,
- make_scoped_ptr(new message_center::Notification(
- new_notification->notification())));
+ // Now pass a copy to message center.
+ scoped_ptr<message_center::Notification> message_center_notification(
+ make_scoped_ptr(new message_center::Notification(notification)));
+ message_center_->UpdateNotification(old_id,
+ message_center_notification.Pass());
new_notification->StartDownloads();
return true;