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

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

Issue 2193383002: [Material][Mac] Fixed App Bookmark Item highlight (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | 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_bar_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #import "base/mac/bundle_locations.h" 9 #import "base/mac/bundle_locations.h"
10 #import "base/mac/foundation_util.h" 10 #import "base/mac/foundation_util.h"
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 1964
1965 // Return an autoreleased NSCell suitable for a special button displayed on the 1965 // Return an autoreleased NSCell suitable for a special button displayed on the
1966 // bookmark bar that is not attached to any bookmark node. 1966 // bookmark bar that is not attached to any bookmark node.
1967 // TODO(jrg): move much of the cell config into the BookmarkButtonCell class. 1967 // TODO(jrg): move much of the cell config into the BookmarkButtonCell class.
1968 - (BookmarkButtonCell*)cellForCustomButtonWithText:(NSString*)text 1968 - (BookmarkButtonCell*)cellForCustomButtonWithText:(NSString*)text
1969 image:(NSImage*)image { 1969 image:(NSImage*)image {
1970 BookmarkButtonCell* cell = 1970 BookmarkButtonCell* cell =
1971 [BookmarkButtonCell buttonCellWithText:text 1971 [BookmarkButtonCell buttonCellWithText:text
1972 image:image 1972 image:image
1973 menuController:contextMenuController_]; 1973 menuController:contextMenuController_];
1974 if (ui::MaterialDesignController::IsModeMaterial()) 1974 if (ui::MaterialDesignController::IsModeMaterial()) {
1975 [cell setTag:kMaterialStandardButtonTypeWithLimitedClickFeedback]; 1975 [cell setTag:kMaterialStandardButtonTypeWithLimitedClickFeedback];
1976 else 1976 [cell setHighlightsBy:NSNoCellMask];
1977 } else {
1977 [cell setTag:kStandardButtonTypeWithLimitedClickFeedback]; 1978 [cell setTag:kStandardButtonTypeWithLimitedClickFeedback];
1979 }
1978 1980
1979 // Note: a quirk of setting a cell's text color is that it won't work 1981 // Note: a quirk of setting a cell's text color is that it won't work
1980 // until the cell is associated with a button, so we can't theme the cell yet. 1982 // until the cell is associated with a button, so we can't theme the cell yet.
1981 1983
1982 return cell; 1984 return cell;
1983 } 1985 }
1984 1986
1985 // Returns a frame appropriate for the given bookmark cell, suitable 1987 // Returns a frame appropriate for the given bookmark cell, suitable
1986 // for creating an NSButton that will contain it. |xOffset| is the X 1988 // for creating an NSButton that will contain it. |xOffset| is the X
1987 // offset for the frame; it is increased to be an appropriate X offset 1989 // offset for the frame; it is increased to be an appropriate X offset
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
3087 - (id<BookmarkButtonControllerProtocol>)controllerForNode: 3089 - (id<BookmarkButtonControllerProtocol>)controllerForNode:
3088 (const BookmarkNode*)node { 3090 (const BookmarkNode*)node {
3089 // See if it's in the bar, then if it is in the hierarchy of visible 3091 // See if it's in the bar, then if it is in the hierarchy of visible
3090 // folder menus. 3092 // folder menus.
3091 if (bookmarkModel_->bookmark_bar_node() == node) 3093 if (bookmarkModel_->bookmark_bar_node() == node)
3092 return self; 3094 return self;
3093 return [folderController_ controllerForNode:node]; 3095 return [folderController_ controllerForNode:node];
3094 } 3096 }
3095 3097
3096 @end 3098 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698