From cbb6fe5d50a93dd4638e6ffaf1dc0f98360187c1 Mon Sep 17 00:00:00 2001 From: "jeremy@chromium.org" Date: Wed, 3 Feb 2010 14:34:50 +0000 Subject: Support disabling items in submenus of a context menu. Without this change, items in submenus of a context menu where always enabled. With this change, the value we use for [NSMenuItem setEnabled:] is respected. This change is required for an upcoming change that needs this to work. BUG=none TEST=Right-click on a text input field, Spell Checker Options->Show spelling panel shouldn't be disabled. Review URL: http://codereview.chromium.org/567031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37970 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents/render_view_context_menu.cc | 1 + chrome/browser/tab_contents/render_view_context_menu_mac.mm | 1 + 2 files changed, 2 insertions(+) diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index aa25c83..039b245 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -504,6 +504,7 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const { case IDC_SPELLCHECK_SUGGESTION_3: case IDC_SPELLCHECK_SUGGESTION_4: case IDC_SPELLCHECK_MENU: + case IDC_SPELLPANEL_TOGGLE: case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS: case IDS_CONTENT_CONTEXT_VIEWFRAMEINFO: return true; diff --git a/chrome/browser/tab_contents/render_view_context_menu_mac.mm b/chrome/browser/tab_contents/render_view_context_menu_mac.mm index 8e7c01e..25cea42 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_mac.mm +++ b/chrome/browser/tab_contents/render_view_context_menu_mac.mm @@ -140,6 +140,7 @@ void RenderViewContextMenuMac::StartSubMenu(int command_id, action:nil keyEquivalent:@""]); insert_menu_ = [[[NSMenu alloc] init] autorelease]; + [insert_menu_ setAutoenablesItems:NO]; [submenu_item setSubmenu:insert_menu_]; [menu_ addItem:submenu_item]; } -- cgit v1.1