summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 17:08:00 +0000
committersidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 17:08:00 +0000
commit5ad126e1bcb500d8af4a233f60420568d7dd7672 (patch)
treee59149e803d34884fc77f724a4820b3be8a8e5f7 /chrome/browser
parent468fedad688294bfbb80c59cbc1d89748928257a (diff)
downloadchromium_src-5ad126e1bcb500d8af4a233f60420568d7dd7672.zip
chromium_src-5ad126e1bcb500d8af4a233f60420568d7dd7672.tar.gz
chromium_src-5ad126e1bcb500d8af4a233f60420568d7dd7672.tar.bz2
Fix issue 8589: Disable spellcheck field from the context menu when spell check is disabled from the options menu.
Issue=8589 Review URL: http://codereview.chromium.org/60097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13162 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 81b87a9..8e60647 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -294,11 +294,14 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
case IDC_SPELLCHECK_SUGGESTION_3:
case IDC_SPELLCHECK_SUGGESTION_4:
case IDC_SPELLCHECK_MENU:
- case IDC_CHECK_SPELLING_OF_THIS_FIELD:
case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS:
case IDS_CONTENT_CONTEXT_VIEWFRAMEINFO:
return true;
+ case IDC_CHECK_SPELLING_OF_THIS_FIELD:
+ return source_web_contents_->profile()->GetPrefs()->GetBoolean(
+ prefs::kEnableSpellCheck);
+
case IDS_CONTENT_CONTEXT_SAVEFRAMEAS:
case IDS_CONTENT_CONTEXT_PRINTFRAME:
case IDS_CONTENT_CONTEXT_ADDSEARCHENGINE: // Not implemented.
@@ -309,8 +312,11 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
bool RenderViewContextMenu::ItemIsChecked(int id) const {
// Check box for 'Check the Spelling of this field'.
- if (id == IDC_CHECK_SPELLING_OF_THIS_FIELD)
- return params_.spellcheck_enabled;
+ if (id == IDC_CHECK_SPELLING_OF_THIS_FIELD) {
+ PrefService* prefs = source_web_contents_->profile()->GetPrefs();
+ return (params_.spellcheck_enabled &&
+ prefs->GetBoolean(prefs::kEnableSpellCheck));
+ }
// Don't bother getting the display language vector if this isn't a spellcheck
// language.