Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4121)

Unified Diff: chrome/browser/render_view_context_menu_controller.cc

Issue 13731: [chromium-reviews] Add "Enable spell check for this field" menu option in sub context menu for c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/render_view_context_menu_controller.cc
===================================================================
--- chrome/browser/render_view_context_menu_controller.cc (revision 6726)
+++ chrome/browser/render_view_context_menu_controller.cc (working copy)
@@ -182,6 +182,7 @@
case IDC_SPELLCHECK_SUGGESTION_4:
return true;
case IDC_SPELLCHECK_MENU:
+ case IDC_CHECK_SPELLING_OF_THIS_FIELD:
return true;
case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY:
return !params_.misspelled_word.empty();
@@ -200,6 +201,11 @@
}
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;
+
+ // Radio button selection for spell check language.
std::vector<std::wstring> display_language_vector;
int spellcheck_language_index = SpellChecker::
GetSpellCheckLanguagesToDisplayInContextMenu(
@@ -441,6 +447,9 @@
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);

Powered by Google App Engine
This is Rietveld 408576698