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

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

Issue 1380083005: Mac: Use [NSArray firstObject] for [NSScreen screens] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « ui/gfx/screen_mac.mm ('k') | ui/snapshot/snapshot_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 - (void)setAnimationEndedCallback: 143 - (void)setAnimationEndedCallback:
144 (message_center::AnimationEndedCallback)callback { 144 (message_center::AnimationEndedCallback)callback {
145 testingAnimationEndedCallback_.reset(Block_copy(callback)); 145 testingAnimationEndedCallback_.reset(Block_copy(callback));
146 } 146 }
147 147
148 // Private ///////////////////////////////////////////////////////////////////// 148 // Private /////////////////////////////////////////////////////////////////////
149 149
150 - (NSRect)screenFrame { 150 - (NSRect)screenFrame {
151 if (!NSIsEmptyRect(testingScreenFrame_)) 151 if (!NSIsEmptyRect(testingScreenFrame_))
152 return testingScreenFrame_; 152 return testingScreenFrame_;
153 return [[[NSScreen screens] objectAtIndex:0] visibleFrame]; 153 return [[[NSScreen screens] firstObject] visibleFrame];
154 } 154 }
155 155
156 - (BOOL)addNotification:(const message_center::Notification*)notification { 156 - (BOOL)addNotification:(const message_center::Notification*)notification {
157 // Wait till all existing animations end. 157 // Wait till all existing animations end.
158 if ([self isAnimating]) 158 if ([self isAnimating])
159 return NO; 159 return NO;
160 160
161 // The popup is owned by itself. It will be released at close. 161 // The popup is owned by itself. It will be released at close.
162 MCPopupController* popup = 162 MCPopupController* popup =
163 [[MCPopupController alloc] initWithNotification:notification 163 [[MCPopupController alloc] initWithNotification:notification
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } 389 }
390 390
391 pendingUpdateNotificationIDs_.clear(); 391 pendingUpdateNotificationIDs_.clear();
392 392
393 // Start re-layout of all notifications, so that it readjusts the Y origin of 393 // Start re-layout of all notifications, so that it readjusts the Y origin of
394 // all updated popups and any popups that come below them. 394 // all updated popups and any popups that come below them.
395 [self layoutNotifications]; 395 [self layoutNotifications];
396 } 396 }
397 397
398 @end 398 @end
OLDNEW
« no previous file with comments | « ui/gfx/screen_mac.mm ('k') | ui/snapshot/snapshot_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698