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

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

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 <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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/handler_options_handler.cc ('k') | chrome/browser/ui/webui/options/options_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698