| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #import "ui/message_center/cocoa/popup_collection.h" | 5 #import "ui/message_center/cocoa/popup_collection.h" |
| 6 | 6 |
| 7 #import "ui/message_center/cocoa/notification_controller.h" | 7 #import "ui/message_center/cocoa/notification_controller.h" |
| 8 #import "ui/message_center/cocoa/popup_controller.h" | 8 #import "ui/message_center/cocoa/popup_controller.h" |
| 9 #include "ui/message_center/message_center.h" | 9 #include "ui/message_center/message_center.h" |
| 10 #include "ui/message_center/message_center_observer.h" | 10 #include "ui/message_center/message_center_observer.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 y -= message_center::kMarginBetweenItems + NSHeight(popupFrame); | 185 y -= message_center::kMarginBetweenItems + NSHeight(popupFrame); |
| 186 | 186 |
| 187 if (y > NSMinY(screenFrame)) { | 187 if (y > NSMinY(screenFrame)) { |
| 188 animatingNotificationIDs_.insert(notification->id()); | 188 animatingNotificationIDs_.insert(notification->id()); |
| 189 NSRect bounds = [popup bounds]; | 189 NSRect bounds = [popup bounds]; |
| 190 bounds.origin.x = x; | 190 bounds.origin.x = x; |
| 191 bounds.origin.y = y; | 191 bounds.origin.y = y; |
| 192 [popup showWithAnimation:bounds]; | 192 [popup showWithAnimation:bounds]; |
| 193 [popups_ addObject:popup]; | 193 [popups_ addObject:popup]; |
| 194 messageCenter_->DisplayedNotification(notification->id()); | 194 messageCenter_->PoppedUpNotification(notification->id()); |
| 195 return YES; | 195 return YES; |
| 196 } | 196 } |
| 197 | 197 |
| 198 // The popup cannot fit on screen, so it has to be released now. | 198 // The popup cannot fit on screen, so it has to be released now. |
| 199 [popup release]; | 199 [popup release]; |
| 200 return NO; | 200 return NO; |
| 201 } | 201 } |
| 202 | 202 |
| 203 - (void)updateNotification:(const std::string&)notificationID { | 203 - (void)updateNotification:(const std::string&)notificationID { |
| 204 // The notification may not be on screen. | 204 // The notification may not be on screen. |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 390 } |
| 391 | 391 |
| 392 pendingUpdateNotificationIDs_.clear(); | 392 pendingUpdateNotificationIDs_.clear(); |
| 393 | 393 |
| 394 // Start re-layout of all notifications, so that it readjusts the Y origin of | 394 // Start re-layout of all notifications, so that it readjusts the Y origin of |
| 395 // all updated popups and any popups that come below them. | 395 // all updated popups and any popups that come below them. |
| 396 [self layoutNotifications]; | 396 [self layoutNotifications]; |
| 397 } | 397 } |
| 398 | 398 |
| 399 @end | 399 @end |
| OLD | NEW |