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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 TranslateService::GetTargetLanguage(prefs); | 131 TranslateService::GetTargetLanguage(prefs); |
132 localized_strings->SetString("defaultTargetLanguage", | 132 localized_strings->SetString("defaultTargetLanguage", |
133 default_target_language); | 133 default_target_language); |
134 | 134 |
135 std::vector<std::string> languages; | 135 std::vector<std::string> languages; |
136 translate::TranslateDownloadManager::GetSupportedLanguages(&languages); | 136 translate::TranslateDownloadManager::GetSupportedLanguages(&languages); |
137 | 137 |
138 base::ListValue* languages_list = new base::ListValue(); | 138 base::ListValue* languages_list = new base::ListValue(); |
139 for (std::vector<std::string>::iterator it = languages.begin(); | 139 for (std::vector<std::string>::iterator it = languages.begin(); |
140 it != languages.end(); ++it) { | 140 it != languages.end(); ++it) { |
141 languages_list->Append(new base::StringValue(*it)); | 141 languages_list->AppendString(*it); |
142 } | 142 } |
143 | 143 |
144 localized_strings->Set("translateSupportedLanguages", languages_list); | 144 localized_strings->Set("translateSupportedLanguages", languages_list); |
145 } | 145 } |
146 | 146 |
147 void LanguageOptionsHandlerCommon::Uninitialize() { | 147 void LanguageOptionsHandlerCommon::Uninitialize() { |
148 SpellcheckService* service = GetSpellcheckService(); | 148 SpellcheckService* service = GetSpellcheckService(); |
149 if (!service) | 149 if (!service) |
150 return; | 150 return; |
151 | 151 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 return; | 308 return; |
309 } | 309 } |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 SpellcheckService* LanguageOptionsHandlerCommon::GetSpellcheckService() { | 313 SpellcheckService* LanguageOptionsHandlerCommon::GetSpellcheckService() { |
314 return SpellcheckServiceFactory::GetForContext(Profile::FromWebUI(web_ui())); | 314 return SpellcheckServiceFactory::GetForContext(Profile::FromWebUI(web_ui())); |
315 } | 315 } |
316 | 316 |
317 } // namespace options | 317 } // namespace options |
OLD | NEW |