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/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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 !prospective_locale.empty() ? prospective_locale : application_locale); | 113 !prospective_locale.empty() ? prospective_locale : application_locale); |
114 localized_strings->Set("spellCheckLanguageCodeSet", | 114 localized_strings->Set("spellCheckLanguageCodeSet", |
115 GetSpellCheckLanguageCodeSet()); | 115 GetSpellCheckLanguageCodeSet()); |
116 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet()); | 116 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet()); |
117 | 117 |
118 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 118 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
119 bool enable_spelling_auto_correct = | 119 bool enable_spelling_auto_correct = |
120 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect); | 120 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect); |
121 localized_strings->SetBoolean("enableSpellingAutoCorrect", | 121 localized_strings->SetBoolean("enableSpellingAutoCorrect", |
122 enable_spelling_auto_correct); | 122 enable_spelling_auto_correct); |
123 bool enable_translate_settings = | |
124 command_line.HasSwitch(switches::kEnableTranslateSettings); | |
125 localized_strings->SetBoolean("enableTranslateSettings", | |
126 enable_translate_settings); | |
127 | 123 |
128 Profile* profile = Profile::FromWebUI(web_ui()); | 124 Profile* profile = Profile::FromWebUI(web_ui()); |
129 PrefService* prefs = profile->GetPrefs(); | 125 PrefService* prefs = profile->GetPrefs(); |
130 std::string default_target_language = | 126 std::string default_target_language = |
131 TranslateManager::GetTargetLanguage(prefs); | 127 TranslateManager::GetTargetLanguage(prefs); |
132 localized_strings->SetString("defaultTargetLanguage", | 128 localized_strings->SetString("defaultTargetLanguage", |
133 default_target_language); | 129 default_target_language); |
134 | 130 |
135 std::vector<std::string> languages; | 131 std::vector<std::string> languages; |
136 TranslateManager::GetSupportedLanguages(&languages); | 132 TranslateManager::GetSupportedLanguages(&languages); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } | 256 } |
261 | 257 |
262 base::WeakPtr<SpellcheckHunspellDictionary>& | 258 base::WeakPtr<SpellcheckHunspellDictionary>& |
263 LanguageOptionsHandlerCommon::GetHunspellDictionary() { | 259 LanguageOptionsHandlerCommon::GetHunspellDictionary() { |
264 if (!hunspell_dictionary_.get()) | 260 if (!hunspell_dictionary_.get()) |
265 RefreshHunspellDictionary(); | 261 RefreshHunspellDictionary(); |
266 return hunspell_dictionary_; | 262 return hunspell_dictionary_; |
267 } | 263 } |
268 | 264 |
269 } // namespace options | 265 } // namespace options |
OLD | NEW |