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

Side by Side Diff: chrome/browser/tab_contents/spellchecker_submenu_observer_hunspell.cc

Issue 11476005: [Spellcheck] Make sure context menu and actual spellcheck state are in sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_service.cc ('k') | chrome/browser/tab_contents/spellchecker_submenu_observer_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698