diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 20:17:56 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 20:17:56 +0000 |
commit | 099b55c0786bed9e57a52c6ab4b0b104fa37f59b (patch) | |
tree | 7638073f2aa20ee1ce9952ecb2e5ce866ad15058 /chrome/browser/cocoa | |
parent | 06c87330d661e508402b6db25bf93ebb0fc25277 (diff) | |
download | chromium_src-099b55c0786bed9e57a52c6ab4b0b104fa37f59b.zip chromium_src-099b55c0786bed9e57a52c6ab4b0b104fa37f59b.tar.gz chromium_src-099b55c0786bed9e57a52c6ab4b0b104fa37f59b.tar.bz2 |
Disable open all bookmarks context menu item if there are no bookmarks.
BUG=http://crbug.com/26071
TEST=New empty bookmark bar. Maker sure "Open all bookmarks" in context menu is disabled.
(You'll need to click in the bottom of the bar so you don't overlap the text).
Add a bookmark.
Make sure "Open all bookmarks" in context menu is ENabled.
Review URL: http://codereview.chromium.org/351018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30853 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_controller.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm index 94c8eff..ad6f68b 100644 --- a/chrome/browser/cocoa/bookmark_bar_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_controller.mm @@ -310,6 +310,17 @@ return node; } +// At this time, the only item which ever gets disabled is "Open All +// Bookmarks". +- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { + SEL action = [item action]; + if ((action == @selector(openAllBookmarks:)) && + (![buttons_ count])) { + return NO; + } + return YES; +} + - (IBAction)openBookmark:(id)sender { BookmarkNode* node = [self nodeFromButton:sender]; [urlDelegate_ openBookmarkURL:node->GetURL() |