| 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 return YES; | 432 return YES; |
| 433 } | 433 } |
| 434 | 434 |
| 435 - (void)drawRect:(NSRect)rect { | 435 - (void)drawRect:(NSRect)rect { |
| 436 NSView* bookmarkBarToolbarView = [[self superview] superview]; | 436 NSView* bookmarkBarToolbarView = [[self superview] superview]; |
| 437 [self cr_drawUsingAncestor:bookmarkBarToolbarView inRect:(NSRect)rect]; | 437 [self cr_drawUsingAncestor:bookmarkBarToolbarView inRect:(NSRect)rect]; |
| 438 [super drawRect:rect]; | 438 [super drawRect:rect]; |
| 439 } | 439 } |
| 440 | 440 |
| 441 - (void)updateIconToMatchTheme { | 441 - (void)updateIconToMatchTheme { |
| 442 if (!ui::MaterialDesignController::IsModeMaterial() || ![self isFolder]) { | 442 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 443 return; | 443 return; |
| 444 } | 444 } |
| 445 | 445 |
| 446 // During testing, the window might not be a browser window, and the | 446 // During testing, the window might not be a browser window, and the |
| 447 // superview might not be a BookmarkBarView. | 447 // superview might not be a BookmarkBarView. |
| 448 if (![[self window] respondsToSelector:@selector(hasDarkTheme)] || | 448 if (![[self window] respondsToSelector:@selector(hasDarkTheme)] || |
| 449 ![[self superview] isKindOfClass:[BookmarkBarView class]]) { | 449 ![[self superview] isKindOfClass:[BookmarkBarView class]]) { |
| 450 return; | 450 return; |
| 451 } | 451 } |
| 452 | 452 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 [[cell clipPathForFrame:bounds inView:self] setClip]; | 522 [[cell clipPathForFrame:bounds inView:self] setClip]; |
| 523 [cell drawWithFrame:bounds inView:self]; | 523 [cell drawWithFrame:bounds inView:self]; |
| 524 | 524 |
| 525 CGContextEndTransparencyLayer(cgContext); | 525 CGContextEndTransparencyLayer(cgContext); |
| 526 [image unlockFocus]; | 526 [image unlockFocus]; |
| 527 | 527 |
| 528 return image.autorelease(); | 528 return image.autorelease(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 @end | 531 @end |
| OLD | NEW |