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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_mac.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 | « no previous file | chrome/browser/ui/cocoa/apps/native_app_window_cocoa.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/ui/app_list/app_list_service_mac.h" 5 #import "chrome/browser/ui/app_list/app_list_service_mac.h"
6 6
7 #include <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 screen->GetDisplayNearestWindow(key_view) : 243 screen->GetDisplayNearestWindow(key_view) :
244 screen->GetPrimaryDisplay(); 244 screen->GetPrimaryDisplay();
245 } else { 245 } else {
246 cursor = screen->GetCursorScreenPoint(); 246 cursor = screen->GetCursorScreenPoint();
247 display = screen->GetDisplayNearestPoint(cursor); 247 display = screen->GetDisplayNearestPoint(cursor);
248 } 248 }
249 249
250 const NSSize ns_window_size = [window frame].size; 250 const NSSize ns_window_size = [window frame].size;
251 gfx::Size window_size(ns_window_size.width, ns_window_size.height); 251 gfx::Size window_size(ns_window_size.width, ns_window_size.height);
252 int primary_display_height = 252 int primary_display_height =
253 NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]); 253 NSMaxY([[[NSScreen screens] firstObject] frame]);
254 AppListServiceMac::FindAnchorPoint(window_size, 254 AppListServiceMac::FindAnchorPoint(window_size,
255 display, 255 display,
256 primary_display_height, 256 primary_display_height,
257 cursor_is_visible, 257 cursor_is_visible,
258 cursor, 258 cursor,
259 target_origin, 259 target_origin,
260 start_origin); 260 start_origin);
261 } 261 }
262 262
263 AppListServiceMac* GetActiveInstance() { 263 AppListServiceMac* GetActiveInstance() {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 578
579 - (void)animationDidEnd:(NSAnimation*)animation { 579 - (void)animationDidEnd:(NSAnimation*)animation {
580 content::BrowserThread::PostTask( 580 content::BrowserThread::PostTask(
581 content::BrowserThread::UI, 581 content::BrowserThread::UI,
582 FROM_HERE, 582 FROM_HERE,
583 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, 583 base::Bind(&AppListServiceMac::WindowAnimationDidEnd,
584 base::Unretained(GetActiveInstance()))); 584 base::Unretained(GetActiveInstance())));
585 } 585 }
586 586
587 @end 587 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698