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

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

Issue 2504753003: Bookmarks bar, tooltip should be seen only for folders with big names on macOS. (Closed)
Patch Set: Add unittest Created 4 years, 1 month 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/bookmarks/bookmark_bar_folder_controller_unittest.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_folder_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/mac/sdk_forward_declarations.h" 10 #include "base/mac/sdk_forward_declarations.h"
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 if (node->is_folder()) { 442 if (node->is_folder()) {
443 [button setTarget:self]; 443 [button setTarget:self];
444 [button setAction:@selector(openBookmarkFolderFromButton:)]; 444 [button setAction:@selector(openBookmarkFolderFromButton:)];
445 } else { 445 } else {
446 // Make the button do something. 446 // Make the button do something.
447 [button setTarget:barController_]; 447 [button setTarget:barController_];
448 [button setAction:@selector(openBookmark:)]; 448 [button setAction:@selector(openBookmark:)];
449 [button setAcceptsTrackIn:YES]; 449 [button setAcceptsTrackIn:YES];
450 } 450 }
451 // Add a tooltip. 451 // Add a tooltip.
452 [button setToolTip:[BookmarkMenuCocoaController tooltipForNode:node]]; 452 if (node->is_folder()) {
453 NSString* title = base::SysUTF16ToNSString(node->GetTitle());
454 if ([title length] &&
455 [[button cell] cellSize].width >
456 bookmarks::kBookmarkMenuButtonMaximumWidth) {
457 [button setToolTip:[BookmarkMenuCocoaController tooltipForNode:node]];
458 }
459 } else {
460 [button setToolTip:[BookmarkMenuCocoaController tooltipForNode:node]];
461 }
453 } else { 462 } else {
454 [button setEnabled:NO]; 463 [button setEnabled:NO];
455 [button setBordered:NO]; 464 [button setBordered:NO];
456 } 465 }
457 return button; 466 return button;
458 } 467 }
459 468
460 - (id)folderTarget { 469 - (id)folderTarget {
461 return folderTarget_.get(); 470 return folderTarget_.get();
462 } 471 }
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 2099
2091 - (void)setIgnoreAnimations:(BOOL)ignore { 2100 - (void)setIgnoreAnimations:(BOOL)ignore {
2092 ignoreAnimations_ = ignore; 2101 ignoreAnimations_ = ignore;
2093 } 2102 }
2094 2103
2095 - (BookmarkButton*)buttonThatMouseIsIn { 2104 - (BookmarkButton*)buttonThatMouseIsIn {
2096 return buttonThatMouseIsIn_; 2105 return buttonThatMouseIsIn_;
2097 } 2106 }
2098 2107
2099 @end // BookmarkBarFolderController 2108 @end // BookmarkBarFolderController
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698