summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_view_context_menu_controller.cc
diff options
context:
space:
mode:
authorsidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-15 20:18:04 +0000
committersidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-15 20:18:04 +0000
commitbbbd545cc226d409d131afb806e1ae5df3e5aa73 (patch)
tree6c87d2afde518b04a7b19813c2ec360ba6afbf1f /chrome/browser/render_view_context_menu_controller.cc
parentbdb1d32442597e46583a79c0af560e6cc9e57214 (diff)
downloadchromium_src-bbbd545cc226d409d131afb806e1ae5df3e5aa73.zip
chromium_src-bbbd545cc226d409d131afb806e1ae5df3e5aa73.tar.gz
chromium_src-bbbd545cc226d409d131afb806e1ae5df3e5aa73.tar.bz2
Add "Enable spell check for this field" menu option in sub context menu for context menu over text box, and deploy its functionality accordingly across the code. This patch also allows manual switch-on of spell check in single line text box fields.
Review URL: http://codereview.chromium.org/13731 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_context_menu_controller.cc')
-rw-r--r--chrome/browser/render_view_context_menu_controller.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/render_view_context_menu_controller.cc b/chrome/browser/render_view_context_menu_controller.cc
index 186fe0b..76a6279 100644
--- a/chrome/browser/render_view_context_menu_controller.cc
+++ b/chrome/browser/render_view_context_menu_controller.cc
@@ -190,6 +190,7 @@ bool RenderViewContextMenuController::IsCommandEnabled(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;
@@ -203,6 +204,10 @@ bool RenderViewContextMenuController::IsCommandEnabled(int id) const {
}
bool RenderViewContextMenuController::IsItemChecked(int id) const {
+ // Check box for 'Check the Spelling of this field'.
+ if (id == IDC_CHECK_SPELLING_OF_THIS_FIELD)
+ return params_.spellcheck_enabled;
+
// Don't bother getting the display language vector if this isn't a spellcheck
// language.
if ((id < IDC_SPELLCHECK_LANGUAGES_FIRST) ||
@@ -446,6 +451,9 @@ void RenderViewContextMenuController::ExecuteCommand(int id) {
params_.dictionary_suggestions[id - IDC_SPELLCHECK_SUGGESTION_0]);
break;
+ case IDC_CHECK_SPELLING_OF_THIS_FIELD:
+ source_web_contents_->render_view_host()->ToggleSpellCheck();
+ break;
case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY:
source_web_contents_->render_view_host()->AddToDictionary(
params_.misspelled_word);