Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / message_center / cocoa / popup_collection.mm
index fb22019..adc4f62 100644 (file)
@@ -191,7 +191,8 @@ class PopupCollectionObserver : public message_center::MessageCenterObserver {
     bounds.origin.y = y;
     [popup showWithAnimation:bounds];
     [popups_ addObject:popup];
-    messageCenter_->DisplayedNotification(notification->id());
+    messageCenter_->DisplayedNotification(
+        notification->id(), message_center::DISPLAY_SOURCE_POPUP);
     return YES;
   }
 
@@ -201,9 +202,11 @@ class PopupCollectionObserver : public message_center::MessageCenterObserver {
 }
 
 - (void)updateNotification:(const std::string&)notificationID {
-  // The notification may not be on screen.
-  if ([self indexOfPopupWithNotificationID:notificationID] == NSNotFound)
+  // The notification may not be on screen. Create it if needed.
+  if ([self indexOfPopupWithNotificationID:notificationID] == NSNotFound) {
+    [self layoutNewNotifications];
     return;
+  }
 
   // Don't bother with the update if the notification is going to be removed.
   if (pendingRemoveNotificationIDs_.find(notificationID) !=