Chromium Code Reviews| 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; |