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

Unified Diff: chrome/browser/tab_contents/spellchecker_submenu_observer_hunspell.cc

Issue 10548022: Synchronize the check status of the "Check Spelling While Typing" item. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months 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/tab_contents/spellchecker_submenu_observer_hunspell.cc
===================================================================
--- chrome/browser/tab_contents/spellchecker_submenu_observer_hunspell.cc (revision 141803)
+++ chrome/browser/tab_contents/spellchecker_submenu_observer_hunspell.cc (working copy)
@@ -115,9 +115,7 @@
// Check box for 'Check Spelling while typing'.
if (command_id == IDC_CHECK_SPELLING_WHILE_TYPING) {
Profile* profile = proxy_->GetProfile();
- if (!profile || !profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck))
- return false;
- return spellcheck_enabled_;
+ return profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck);
}
return false;
@@ -138,8 +136,6 @@
switch (command_id) {
case IDC_CHECK_SPELLING_WHILE_TYPING:
- return pref->GetBoolean(prefs::kEnableSpellCheck);
-
case IDC_SPELLPANEL_TOGGLE:
case IDC_SPELLCHECK_MENU:
return true;
@@ -152,9 +148,9 @@
DCHECK(IsCommandIdSupported(command_id));
// Check to see if one of the spell check language ids have been clicked.
+ Profile* profile = proxy_->GetProfile();
if (command_id >= IDC_SPELLCHECK_LANGUAGES_FIRST &&
command_id < IDC_SPELLCHECK_LANGUAGES_LAST) {
- Profile* profile = proxy_->GetProfile();
const size_t language = command_id - IDC_SPELLCHECK_LANGUAGES_FIRST;
if (profile && language < languages_.size()) {
StringPrefMember dictionary_language;
@@ -169,6 +165,9 @@
content::RenderViewHost* rvh = proxy_->GetRenderViewHost();
switch (command_id) {
case IDC_CHECK_SPELLING_WHILE_TYPING:
+ profile->GetPrefs()->SetBoolean(
+ prefs::kEnableSpellCheck,
+ !profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck));
rvh->Send(new SpellCheckMsg_ToggleSpellCheck(rvh->GetRoutingID()));
break;
}

Powered by Google App Engine
This is Rietveld 408576698