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

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

Issue 2008403002: [Mac][Material Design] Restore apps page shortcut icon in bookmarks bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
453 BookmarkBarView* bookmarkBarView = 453 BookmarkBarView* bookmarkBarView =
454 base::mac::ObjCCastStrict<BookmarkBarView>([self superview]); 454 base::mac::ObjCCastStrict<BookmarkBarView>([self superview]);
455 BookmarkBarController* bookmarkBarController = [bookmarkBarView controller]; 455 BookmarkBarController* bookmarkBarController = [bookmarkBarView controller];
456
457 // The apps page shortcut button does not need to be updated.
458 if (self == [bookmarkBarController appsPageShortcutButton]) {
459 return;
460 }
461
456 BOOL darkTheme = [[self window] hasDarkTheme]; 462 BOOL darkTheme = [[self window] hasDarkTheme];
457 NSImage* theImage = nil; 463 NSImage* theImage = nil;
458 // Make sure the "off the side" button gets the chevron icon. 464 // Make sure the "off the side" button gets the chevron icon.
459 if ([bookmarkBarController offTheSideButton] == self) { 465 if ([bookmarkBarController offTheSideButton] == self) {
460 theImage = [bookmarkBarController offTheSideButtonImage:darkTheme]; 466 theImage = [bookmarkBarController offTheSideButtonImage:darkTheme];
461 } else { 467 } else {
462 theImage = [bookmarkBarController faviconForNode:[self bookmarkNode] 468 theImage = [bookmarkBarController faviconForNode:[self bookmarkNode]
463 forADarkTheme:darkTheme]; 469 forADarkTheme:darkTheme];
464 } 470 }
465 471
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 [[cell clipPathForFrame:bounds inView:self] setClip]; 528 [[cell clipPathForFrame:bounds inView:self] setClip];
523 [cell drawWithFrame:bounds inView:self]; 529 [cell drawWithFrame:bounds inView:self];
524 530
525 CGContextEndTransparencyLayer(cgContext); 531 CGContextEndTransparencyLayer(cgContext);
526 [image unlockFocus]; 532 [image unlockFocus];
527 533
528 return image.autorelease(); 534 return image.autorelease();
529 } 535 }
530 536
531 @end 537 @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