| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" | 5 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" | 10 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 DCHECK(IsCommandIdSupported(command_id)); | 106 DCHECK(IsCommandIdSupported(command_id)); |
| 107 | 107 |
| 108 content::RenderViewHost* rvh = proxy_->GetRenderViewHost(); | 108 content::RenderViewHost* rvh = proxy_->GetRenderViewHost(); |
| 109 Profile* profile = proxy_->GetProfile(); | 109 Profile* profile = proxy_->GetProfile(); |
| 110 DCHECK(profile); | 110 DCHECK(profile); |
| 111 switch (command_id) { | 111 switch (command_id) { |
| 112 case IDC_CHECK_SPELLING_WHILE_TYPING: | 112 case IDC_CHECK_SPELLING_WHILE_TYPING: |
| 113 profile->GetPrefs()->SetBoolean( | 113 profile->GetPrefs()->SetBoolean( |
| 114 prefs::kEnableSpellCheck, | 114 prefs::kEnableSpellCheck, |
| 115 !profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); | 115 !profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); |
| 116 if (rvh) | |
| 117 rvh->Send(new SpellCheckMsg_ToggleSpellCheck(rvh->GetRoutingID())); | |
| 118 break; | 116 break; |
| 119 | 117 |
| 120 case IDC_SPELLPANEL_TOGGLE: | 118 case IDC_SPELLPANEL_TOGGLE: |
| 121 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( | 119 rvh->Send(new SpellCheckMsg_ToggleSpellPanel( |
| 122 rvh->GetRoutingID(), spellcheck_mac::SpellingPanelVisible())); | 120 rvh->GetRoutingID(), spellcheck_mac::SpellingPanelVisible())); |
| 123 break; | 121 break; |
| 124 } | 122 } |
| 125 } | 123 } |
| OLD | NEW |