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_->DisplayedNotification( |
| 195 notification->id(), message_center::DISPLAY_SOURCE_POPUP); |
195 return YES; | 196 return YES; |
196 } | 197 } |
197 | 198 |
198 // The popup cannot fit on screen, so it has to be released now. | 199 // The popup cannot fit on screen, so it has to be released now. |
199 [popup release]; | 200 [popup release]; |
200 return NO; | 201 return NO; |
201 } | 202 } |
202 | 203 |
203 - (void)updateNotification:(const std::string&)notificationID { | 204 - (void)updateNotification:(const std::string&)notificationID { |
204 // The notification may not be on screen. | 205 // The notification may not be on screen. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 391 } |
391 | 392 |
392 pendingUpdateNotificationIDs_.clear(); | 393 pendingUpdateNotificationIDs_.clear(); |
393 | 394 |
394 // Start re-layout of all notifications, so that it readjusts the Y origin of | 395 // 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. | 396 // all updated popups and any popups that come below them. |
396 [self layoutNotifications]; | 397 [self layoutNotifications]; |
397 } | 398 } |
398 | 399 |
399 @end | 400 @end |
OLD | NEW |