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

Unified Diff: chrome/browser/ui/cocoa/browser_window_cocoa.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 028c744d53dd56751ccc7c2e29262a534a056ffc..a3716da41c805f1851fda68b3c0864783e6bcc64 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -210,7 +210,7 @@ void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) {
real_bounds.width(),
real_bounds.height());
// Flip coordinates based on the primary screen.
- NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
+ NSScreen* screen = [[NSScreen screens] firstObject];
cocoa_bounds.origin.y =
NSHeight([screen frame]) - real_bounds.height() - real_bounds.y();
@@ -348,7 +348,7 @@ void BrowserWindowCocoa::ZoomChangedForActiveTab(bool can_show_bubble) {
gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const {
// Flip coordinates based on the primary screen.
- NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
+ NSScreen* screen = [[NSScreen screens] firstObject];
NSRect frame = [controller_ regularWindowFrame];
gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));

Powered by Google App Engine
This is Rietveld 408576698