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

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

Issue 2082383004: [Material][Mac] Fix for Bookmark Button's highlight issues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | chrome/browser/ui/cocoa/gradient_button_cell.mm » ('j') | 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 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 // http://crbug.com/35966 2630 // http://crbug.com/35966
2631 // If already opened, then we exited but re-entered the button, so do nothing. 2631 // If already opened, then we exited but re-entered the button, so do nothing.
2632 if ([folderController_ parentButton] == sender) 2632 if ([folderController_ parentButton] == sender)
2633 return; 2633 return;
2634 // Else open a new one if it makes sense to do so. 2634 // Else open a new one if it makes sense to do so.
2635 const BookmarkNode* node = [sender bookmarkNode]; 2635 const BookmarkNode* node = [sender bookmarkNode];
2636 if (node && node->is_folder()) { 2636 if (node && node->is_folder()) {
2637 // Update |hoverButton_| so that it corresponds to the open folder. 2637 // Update |hoverButton_| so that it corresponds to the open folder.
2638 hoverButton_.reset([sender retain]); 2638 hoverButton_.reset([sender retain]);
2639 [folderTarget_ openBookmarkFolderFromButton:sender]; 2639 [folderTarget_ openBookmarkFolderFromButton:sender];
2640
2641 const BookmarkButtonCell* cell = [sender cell];
2642 if ([cell tag] == kMaterialStandardButtonTypeWithLimitedClickFeedback)
2643 [cell setHighlighted:YES];
2640 } else { 2644 } else {
2641 // We're over a non-folder bookmark so close any old folders. 2645 // We're over a non-folder bookmark so close any old folders.
2642 [folderController_ close]; 2646 [folderController_ close];
2643 folderController_ = nil; 2647 folderController_ = nil;
2644 } 2648 }
2645 } 2649 }
2646 2650
2647 // BookmarkButtonDelegate protocol implementation. 2651 // BookmarkButtonDelegate protocol implementation.
2648 - (void)mouseExitedButton:(id)sender event:(NSEvent*)event { 2652 - (void)mouseExitedButton:(id)sender event:(NSEvent*)event {
2649 // Don't care; do nothing. 2653 // Don't care; do nothing.
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 - (id<BookmarkButtonControllerProtocol>)controllerForNode: 3095 - (id<BookmarkButtonControllerProtocol>)controllerForNode:
3092 (const BookmarkNode*)node { 3096 (const BookmarkNode*)node {
3093 // See if it's in the bar, then if it is in the hierarchy of visible 3097 // See if it's in the bar, then if it is in the hierarchy of visible
3094 // folder menus. 3098 // folder menus.
3095 if (bookmarkModel_->bookmark_bar_node() == node) 3099 if (bookmarkModel_->bookmark_bar_node() == node)
3096 return self; 3100 return self;
3097 return [folderController_ controllerForNode:node]; 3101 return [folderController_ controllerForNode:node];
3098 } 3102 }
3099 3103
3100 @end 3104 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/gradient_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698