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

Unified Diff: ui/message_center/message_center_impl.cc

Issue 14127003: Fixes a crash caused for update of webkit notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | 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 012d0dfeb4a2aaf101e93812edc0c3a5c3dd3636..d89f9816ce18569210288199a67f46780bb8fd7b 100644
--- a/ui/message_center/message_center_impl.cc
+++ b/ui/message_center/message_center_impl.cc
@@ -106,8 +106,15 @@ void MessageCenterImpl::UpdateNotification(
const base::DictionaryValue* optional_fields) {
notification_list_->UpdateNotificationMessage(
old_id, new_id, title, message, optional_fields);
- FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
- OnNotificationUpdated(new_id));
+ if (old_id == new_id) {
+ FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
+ OnNotificationUpdated(new_id));
+ } else {
+ FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
+ OnNotificationRemoved(old_id, false));
+ FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
+ OnNotificationAdded(new_id));
+ }
}
void MessageCenterImpl::RemoveNotification(const std::string& id,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698