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

Side by Side Diff: ui/app_list/cocoa/apps_search_results_controller.mm

Issue 646353002: Give up on threaded animations for the Mac App Launcher NSWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « chrome/browser/ui/app_list/app_list_service_mac.mm ('k') | no next file » | 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 "ui/app_list/cocoa/apps_search_results_controller.h" 5 #import "ui/app_list/cocoa/apps_search_results_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 @end 396 @end
397 397
398 @implementation AppsSearchResultsTableView 398 @implementation AppsSearchResultsTableView
399 399
400 - (AppsSearchResultsController*)controller { 400 - (AppsSearchResultsController*)controller {
401 return base::mac::ObjCCastStrict<AppsSearchResultsController>( 401 return base::mac::ObjCCastStrict<AppsSearchResultsController>(
402 [self delegate]); 402 [self delegate]);
403 } 403 }
404 404
405 - (BOOL)canDraw {
406 // AppKit doesn't call -[NSView canDrawConcurrently] which would have told it
407 // that this is unsafe. Returning true from canDraw only if there is a message
408 // loop ensures that no drawing occurs on a background thread. Without this,
409 // ImageSkia can assert when trying to get bitmaps. http://crbug.com/417148.
410 // This means unit tests will always return 'NO', but that's OK.
411 return !!base::MessageLoop::current() && [super canDraw];
412 }
413
414 - (void)mouseDown:(NSEvent*)theEvent { 405 - (void)mouseDown:(NSEvent*)theEvent {
415 [[self controller] mouseDown:theEvent]; 406 [[self controller] mouseDown:theEvent];
416 [super mouseDown:theEvent]; 407 [super mouseDown:theEvent];
417 } 408 }
418 409
419 - (NSMenu*)menuForEvent:(NSEvent*)theEvent { 410 - (NSMenu*)menuForEvent:(NSEvent*)theEvent {
420 NSPoint pointInView = [self convertPoint:[theEvent locationInWindow] 411 NSPoint pointInView = [self convertPoint:[theEvent locationInWindow]
421 fromView:nil]; 412 fromView:nil];
422 return [[self controller] contextMenuForRow:[self rowAtPoint:pointInView]]; 413 return [[self controller] contextMenuForRow:[self rowAtPoint:pointInView]];
423 } 414 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 std::min(iconSize.height, kIconDimension)); 455 std::min(iconSize.height, kIconDimension));
465 [resultIcon drawInRect:iconRect 456 [resultIcon drawInRect:iconRect
466 fromRect:NSZeroRect 457 fromRect:NSZeroRect
467 operation:NSCompositeSourceOver 458 operation:NSCompositeSourceOver
468 fraction:1.0 459 fraction:1.0
469 respectFlipped:YES 460 respectFlipped:YES
470 hints:nil]; 461 hints:nil];
471 } 462 }
472 463
473 @end 464 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698