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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 std::string application_locale = g_browser_process->GetApplicationLocale(); | 111 std::string application_locale = g_browser_process->GetApplicationLocale(); |
112 localized_strings->SetString("currentUiLanguageCode", application_locale); | 112 localized_strings->SetString("currentUiLanguageCode", application_locale); |
113 std::string prospective_locale = | 113 std::string prospective_locale = |
114 g_browser_process->local_state()->GetString(prefs::kApplicationLocale); | 114 g_browser_process->local_state()->GetString(prefs::kApplicationLocale); |
115 localized_strings->SetString("prospectiveUiLanguageCode", | 115 localized_strings->SetString("prospectiveUiLanguageCode", |
116 !prospective_locale.empty() ? prospective_locale : application_locale); | 116 !prospective_locale.empty() ? prospective_locale : application_locale); |
117 localized_strings->Set("spellCheckLanguageCodeSet", | 117 localized_strings->Set("spellCheckLanguageCodeSet", |
118 GetSpellCheckLanguageCodeSet()); | 118 GetSpellCheckLanguageCodeSet()); |
119 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet()); | 119 localized_strings->Set("uiLanguageCodeSet", GetUILanguageCodeSet()); |
120 | 120 |
121 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 121 const base::CommandLine& command_line = |
| 122 *base::CommandLine::ForCurrentProcess(); |
122 bool enable_spelling_auto_correct = | 123 bool enable_spelling_auto_correct = |
123 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect); | 124 command_line.HasSwitch(switches::kEnableSpellingAutoCorrect); |
124 localized_strings->SetBoolean("enableSpellingAutoCorrect", | 125 localized_strings->SetBoolean("enableSpellingAutoCorrect", |
125 enable_spelling_auto_correct); | 126 enable_spelling_auto_correct); |
126 | 127 |
127 Profile* profile = Profile::FromWebUI(web_ui()); | 128 Profile* profile = Profile::FromWebUI(web_ui()); |
128 PrefService* prefs = profile->GetPrefs(); | 129 PrefService* prefs = profile->GetPrefs(); |
129 std::string default_target_language = | 130 std::string default_target_language = |
130 TranslateService::GetTargetLanguage(prefs); | 131 TranslateService::GetTargetLanguage(prefs); |
131 localized_strings->SetString("defaultTargetLanguage", | 132 localized_strings->SetString("defaultTargetLanguage", |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 } | 289 } |
289 | 290 |
290 base::WeakPtr<SpellcheckHunspellDictionary>& | 291 base::WeakPtr<SpellcheckHunspellDictionary>& |
291 LanguageOptionsHandlerCommon::GetHunspellDictionary() { | 292 LanguageOptionsHandlerCommon::GetHunspellDictionary() { |
292 if (!hunspell_dictionary_.get()) | 293 if (!hunspell_dictionary_.get()) |
293 RefreshHunspellDictionary(); | 294 RefreshHunspellDictionary(); |
294 return hunspell_dictionary_; | 295 return hunspell_dictionary_; |
295 } | 296 } |
296 | 297 |
297 } // namespace options | 298 } // namespace options |
OLD | NEW |