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

Side by Side Diff: ui/message_center/cocoa/popup_collection.mm

Issue 264123002: Google Now Message Center Stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | ui/message_center/cocoa/tray_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698