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

Side by Side Diff: chrome/browser/ui/webui/options/language_options_handler_common.cc

Issue 1156473007: Enables the user to select multiple languages for spellchecking (UI) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits and rebased. Created 5 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 unified diff | Download patch
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/ui/webui/options/language_options_handler_common.h" 5 #include "chrome/browser/ui/webui/options/language_options_handler_common.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 GetSpellCheckLanguageCodeSet()); 125 GetSpellCheckLanguageCodeSet());
126 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet()); 126 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet());
127 127
128 const base::CommandLine& command_line = 128 const base::CommandLine& command_line =
129 *base::CommandLine::ForCurrentProcess(); 129 *base::CommandLine::ForCurrentProcess();
130 bool enable_spelling_auto_correct = 130 bool enable_spelling_auto_correct =
131 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect); 131 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect);
132 localized_strings->SetBoolean("enableSpellingAutoCorrect", 132 localized_strings->SetBoolean("enableSpellingAutoCorrect",
133 enable_spelling_auto_correct); 133 enable_spelling_auto_correct);
134 134
135 localized_strings->SetBoolean(
136 "enableMultilingualSpellChecker",
137 chrome::spellcheck_common::IsMultilingualSpellcheckEnabled());
138
135 Profile* profile = Profile::FromWebUI(web_ui()); 139 Profile* profile = Profile::FromWebUI(web_ui());
136 PrefService* prefs = profile->GetPrefs(); 140 PrefService* prefs = profile->GetPrefs();
137 std::string default_target_language = 141 std::string default_target_language =
138 TranslateService::GetTargetLanguage(prefs); 142 TranslateService::GetTargetLanguage(prefs);
139 localized_strings->SetString("defaultTargetLanguage", 143 localized_strings->SetString("defaultTargetLanguage",
140 default_target_language); 144 default_target_language);
141 145
142 std::vector<std::string> languages; 146 std::vector<std::string> languages;
143 translate::TranslateDownloadManager::GetSupportedLanguages(&languages); 147 translate::TranslateDownloadManager::GetSupportedLanguages(&languages);
144 148
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 300 }
297 301
298 base::WeakPtr<SpellcheckHunspellDictionary>& 302 base::WeakPtr<SpellcheckHunspellDictionary>&
299 LanguageOptionsHandlerCommon::GetHunspellDictionary() { 303 LanguageOptionsHandlerCommon::GetHunspellDictionary() {
300 if (!hunspell_dictionary_.get()) 304 if (!hunspell_dictionary_.get())
301 RefreshHunspellDictionary(); 305 RefreshHunspellDictionary();
302 return hunspell_dictionary_; 306 return hunspell_dictionary_;
303 } 307 }
304 308
305 } // namespace options 309 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698