diff options
author | maf@chromium.org <maf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 01:33:52 +0000 |
---|---|---|
committer | maf@chromium.org <maf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 01:33:52 +0000 |
commit | 3cdde96049b0a299b85e12dd817b3602decb451c (patch) | |
tree | b7da0a492c38812a910348442a79dc78b7c29e1a | |
parent | cc370bbeaa6a79eb0d91fb604cc1b08c32195102 (diff) | |
download | chromium_src-3cdde96049b0a299b85e12dd817b3602decb451c.zip chromium_src-3cdde96049b0a299b85e12dd817b3602decb451c.tar.gz chromium_src-3cdde96049b0a299b85e12dd817b3602decb451c.tar.bz2 |
Make it easy to tell if BookmarkButtons are being used as menu items or as toolbar buttons.
Use this to fix bug where items in submenus do not flash to confirm selection.
R=mrossetti@chromium.org
BUG=79958
Review URL: http://codereview.chromium.org/6882061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82207 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index ce7e1c0..c8156d0 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -615,7 +615,7 @@ void RecordAppLaunch(Profile* profile, GURL url) { } - (IBAction)openBookmark:(id)sender { - BOOL isMenuItem = ([sender delegate] == folderController_); + BOOL isMenuItem = [[sender cell] isFolderButtonCell]; BOOL animate = isMenuItem && [self animationEnabled]; if (animate) [self doMenuFlashOnSeparateThread:sender]; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell.mm index c03500d..677d1e4 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,4 +19,8 @@ return buttonCell; } +- (BOOL)isFolderButtonCell { + return YES; +} + @end diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h index dbcff34..cce3302 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -60,6 +60,8 @@ class BookmarkNode; // Set the color of text in this cell. - (void)setTextColor:(NSColor*)color; +- (BOOL)isFolderButtonCell; + @end #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm index 294c0f9..0f21ed5 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm @@ -72,6 +72,10 @@ [self configureBookmarkButtonCell]; } +- (BOOL)isFolderButtonCell { + return NO; +} + // Perform all normal init routines specific to the BookmarkButtonCell. - (void)configureBookmarkButtonCell { [self setButtonType:NSMomentaryPushInButton]; |