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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm

Issue 1993313002: [Mac][Material Design] Show light default favicon in Incognito mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/cocoa/bookmarks/bookmark_bar_controller.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 (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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698