Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cocoa/bookmarks/bookmark_button.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 } else { | 398 } else { |
| 399 // Mouse tracked out of button during menu track. Hide menus. | 399 // Mouse tracked out of button during menu track. Hide menus. |
| 400 if (!wasInside) | 400 if (!wasInside) |
| 401 [delegate_ bookmarkDragDidEnd:self | 401 [delegate_ bookmarkDragDidEnd:self |
| 402 operation:NSDragOperationNone]; | 402 operation:NSDragOperationNone]; |
| 403 } | 403 } |
| 404 return kDraggableButtonMixinDidWork; | 404 return kDraggableButtonMixinDidWork; |
| 405 } | 405 } |
| 406 | 406 |
| 407 - (BOOL)isOpaque { | 407 - (BOOL)isOpaque { |
| 408 // Make this control opaque so that sub pixel anti aliasing works when core | 408 // Make this control opaque so that sub-pixel anti-aliasing works when |
| 409 // animation is enabled. | 409 // CoreAnimation is enabled. |
| 410 return YES; | 410 return YES; |
| 411 } | 411 } |
| 412 | 412 |
| 413 - (void)drawRect:(NSRect)rect { | 413 - (void)drawRect:(NSRect)rect { |
|
ccameron
2014/04/16 19:17:55
I kept trying to change this to use VIEW_ID_TOOLBA
| |
| 414 NSView* toolbarView = [[self superview] superview]; | 414 NSView* bookmarkBarToolbarView = [[self superview] superview]; |
| 415 [self cr_drawUsingAncestor:toolbarView inRect:(NSRect)rect]; | 415 [self cr_drawUsingAncestor:bookmarkBarToolbarView inRect:(NSRect)rect]; |
| 416 [super drawRect:rect]; | 416 [super drawRect:rect]; |
| 417 } | 417 } |
| 418 | 418 |
| 419 @end | 419 @end |
| 420 | 420 |
| 421 @implementation BookmarkButton(Private) | 421 @implementation BookmarkButton(Private) |
| 422 | 422 |
| 423 | 423 |
| 424 - (void)installCustomTrackingArea { | 424 - (void)installCustomTrackingArea { |
| 425 const NSTrackingAreaOptions options = | 425 const NSTrackingAreaOptions options = |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 456 [[cell clipPathForFrame:bounds inView:self] setClip]; | 456 [[cell clipPathForFrame:bounds inView:self] setClip]; |
| 457 [cell drawWithFrame:bounds inView:self]; | 457 [cell drawWithFrame:bounds inView:self]; |
| 458 | 458 |
| 459 CGContextEndTransparencyLayer(cgContext); | 459 CGContextEndTransparencyLayer(cgContext); |
| 460 [image unlockFocus]; | 460 [image unlockFocus]; |
| 461 | 461 |
| 462 return image.autorelease(); | 462 return image.autorelease(); |
| 463 } | 463 } |
| 464 | 464 |
| 465 @end // @implementation BookmarkButton(Private) | 465 @end // @implementation BookmarkButton(Private) |
| OLD | NEW |