Index: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
index 337fe2e32625fba2e9b06e6fd8e618e0497b60f1..bad78a5d933dd530bb95cd759b00e9b835eec7b8 100644 |
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
@@ -57,7 +57,7 @@ const int kActivateThrottlePeriodSeconds = 2; |
NSRect GfxToCocoaBounds(gfx::Rect bounds) { |
typedef AppWindow::BoundsSpecification BoundsSpecification; |
- NSRect main_screen_rect = [[[NSScreen screens] objectAtIndex:0] frame]; |
+ NSRect main_screen_rect = [[[NSScreen screens] firstObject] frame]; |
// If coordinates are unspecified, center window on primary screen. |
if (bounds.x() == BoundsSpecification::kUnspecifiedPosition) |
@@ -452,7 +452,7 @@ gfx::NativeWindow NativeAppWindowCocoa::GetNativeWindow() const { |
gfx::Rect NativeAppWindowCocoa::GetRestoredBounds() const { |
// Flip coordinates based on the primary screen. |
- NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
+ NSScreen* screen = [[NSScreen screens] firstObject]; |
NSRect frame = restored_bounds_; |
gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); |
bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); |
@@ -469,7 +469,7 @@ ui::WindowShowState NativeAppWindowCocoa::GetRestoredState() const { |
gfx::Rect NativeAppWindowCocoa::GetBounds() const { |
// Flip coordinates based on the primary screen. |
- NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
+ NSScreen* screen = [[NSScreen screens] firstObject]; |
NSRect frame = [window() frame]; |
gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); |
bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); |
@@ -687,7 +687,7 @@ gfx::Insets NativeAppWindowCocoa::GetFrameInsets() const { |
// Flip the coordinates based on the main screen. |
NSInteger screen_height = |
- NSHeight([[[NSScreen screens] objectAtIndex:0] frame]); |
+ NSHeight([[[NSScreen screens] firstObject] frame]); |
NSRect frame_nsrect = [window() frame]; |
gfx::Rect frame_rect(NSRectToCGRect(frame_nsrect)); |