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

Unified Diff: chrome/browser/tab_contents/spellchecker_submenu_observer_mac.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
« no previous file with comments | « chrome/browser/tab_contents/spellchecker_submenu_observer_hunspell.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/spellchecker_submenu_observer_mac.cc
===================================================================
--- chrome/browser/tab_contents/spellchecker_submenu_observer_mac.cc (revision 141803)
+++ chrome/browser/tab_contents/spellchecker_submenu_observer_mac.cc (working copy)
@@ -84,9 +84,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 check_spelling_while_typing_;
jeremy 2012/06/13 17:43:30 If we're just reading this straight from the prefs
Hironori Bono 2012/06/14 08:16:03 Thanks for noticing it. Yes, we can remove it. I h
+ return profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck);
jeremy 2012/06/13 17:43:30 Are you sure that removing the Null check here is
Hironori Bono 2012/06/14 08:16:03 Thanks for noticing it. Even though I somehow remo
}
return false;
@@ -99,12 +97,8 @@
if (!profile)
return false;
- const PrefService* pref = profile->GetPrefs();
-
switch (command_id) {
case IDC_CHECK_SPELLING_WHILE_TYPING:
- return pref->GetBoolean(prefs::kEnableSpellCheck);
-
case IDC_SPELLPANEL_TOGGLE:
case IDC_SPELLCHECK_MENU:
case IDC_CONTENT_CONTEXT_SPELLING_TOGGLE:
@@ -118,8 +112,12 @@
DCHECK(IsCommandIdSupported(command_id));
content::RenderViewHost* rvh = proxy_->GetRenderViewHost();
+ Profile* profile = proxy_->GetProfile();
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;
« no previous file with comments | « chrome/browser/tab_contents/spellchecker_submenu_observer_hunspell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698