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

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

Issue 654653002: Enables the user to select multiple languages for spellchecking (UI) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 5 years, 9 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 GetSpellCheckLanguageCodeSet()); 118 GetSpellCheckLanguageCodeSet());
119 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet()); 119 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet());
120 120
121 const base::CommandLine& command_line = 121 const base::CommandLine& command_line =
122 *base::CommandLine::ForCurrentProcess(); 122 *base::CommandLine::ForCurrentProcess();
123 bool enable_spelling_auto_correct = 123 bool enable_spelling_auto_correct =
124 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect); 124 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect);
125 localized_strings->SetBoolean("enableSpellingAutoCorrect", 125 localized_strings->SetBoolean("enableSpellingAutoCorrect",
126 enable_spelling_auto_correct); 126 enable_spelling_auto_correct);
127 127
128 localized_strings->SetBoolean("enableMultilingualSpellChecker",
129 command_line.HasSwitch(
130 switches::kEnableMultilingualSpellChecker));
131
128 Profile* profile = Profile::FromWebUI(web_ui()); 132 Profile* profile = Profile::FromWebUI(web_ui());
129 PrefService* prefs = profile->GetPrefs(); 133 PrefService* prefs = profile->GetPrefs();
130 std::string default_target_language = 134 std::string default_target_language =
131 TranslateService::GetTargetLanguage(prefs); 135 TranslateService::GetTargetLanguage(prefs);
132 localized_strings->SetString("defaultTargetLanguage", 136 localized_strings->SetString("defaultTargetLanguage",
133 default_target_language); 137 default_target_language);
134 138
135 std::vector<std::string> languages; 139 std::vector<std::string> languages;
136 translate::TranslateDownloadManager::GetSupportedLanguages(&languages); 140 translate::TranslateDownloadManager::GetSupportedLanguages(&languages);
137 141
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 293 }
290 294
291 base::WeakPtr<SpellcheckHunspellDictionary>& 295 base::WeakPtr<SpellcheckHunspellDictionary>&
292 LanguageOptionsHandlerCommon::GetHunspellDictionary() { 296 LanguageOptionsHandlerCommon::GetHunspellDictionary() {
293 if (!hunspell_dictionary_.get()) 297 if (!hunspell_dictionary_.get())
294 RefreshHunspellDictionary(); 298 RefreshHunspellDictionary();
295 return hunspell_dictionary_; 299 return hunspell_dictionary_;
296 } 300 }
297 301
298 } // namespace options 302 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698