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/api/prefs/pref_member.h" | 9 #include "chrome/browser/api/prefs/pref_member.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 const size_t language = command_id - IDC_SPELLCHECK_LANGUAGES_FIRST; | 152 const size_t language = command_id - IDC_SPELLCHECK_LANGUAGES_FIRST; |
153 if (profile && language < languages_.size()) { | 153 if (profile && language < languages_.size()) { |
154 StringPrefMember dictionary_language; | 154 StringPrefMember dictionary_language; |
155 dictionary_language.Init(prefs::kSpellCheckDictionary, | 155 dictionary_language.Init(prefs::kSpellCheckDictionary, |
156 profile->GetPrefs()); | 156 profile->GetPrefs()); |
157 dictionary_language.SetValue(languages_[language]); | 157 dictionary_language.SetValue(languages_[language]); |
158 } | 158 } |
159 return; | 159 return; |
160 } | 160 } |
161 | 161 |
162 content::RenderViewHost* rvh = proxy_->GetRenderViewHost(); | |
163 switch (command_id) { | 162 switch (command_id) { |
164 case IDC_CHECK_SPELLING_WHILE_TYPING: | 163 case IDC_CHECK_SPELLING_WHILE_TYPING: |
165 profile->GetPrefs()->SetBoolean( | 164 profile->GetPrefs()->SetBoolean( |
166 prefs::kEnableSpellCheck, | 165 prefs::kEnableSpellCheck, |
167 !profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); | 166 !profile->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck)); |
168 if (rvh) | 167 break; |
169 rvh->Send(new SpellCheckMsg_ToggleSpellCheck(rvh->GetRoutingID())); | |
170 break; | |
171 } | 168 } |
172 } | 169 } |
OLD | NEW |