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

Side by Side Diff: chrome/browser/search_engines/template_url_prepopulate_data.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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/search_engines/template_url_prepopulate_data.h" 5 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <locale.h> 8 #include <locale.h>
9 #endif 9 #endif
10 10
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine( 1198 TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine(
1199 Profile* profile, 1199 Profile* profile,
1200 const PrepopulatedEngine& engine) { 1200 const PrepopulatedEngine& engine) {
1201 1201
1202 ListValue alternate_urls; 1202 ListValue alternate_urls;
1203 if (engine.alternate_urls) { 1203 if (engine.alternate_urls) {
1204 for (size_t i = 0; i < engine.alternate_urls_size; ++i) 1204 for (size_t i = 0; i < engine.alternate_urls_size; ++i)
1205 alternate_urls.AppendString(std::string(engine.alternate_urls[i])); 1205 alternate_urls.AppendString(std::string(engine.alternate_urls[i]));
1206 } 1206 }
1207 1207
1208 return MakePrepopulatedTemplateURL(profile, WideToUTF16(engine.name), 1208 return MakePrepopulatedTemplateURL(profile, base::WideToUTF16(engine.name),
1209 WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url, 1209 base::WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url,
1210 engine.instant_url, engine.favicon_url, engine.encoding, alternate_urls, 1210 engine.instant_url, engine.favicon_url, engine.encoding, alternate_urls,
1211 engine.search_terms_replacement_key, engine.id); 1211 engine.search_terms_replacement_key, engine.id);
1212 } 1212 }
1213 1213
1214 void GetPrepopulatedEngines(Profile* profile, 1214 void GetPrepopulatedEngines(Profile* profile,
1215 std::vector<TemplateURL*>* t_urls, 1215 std::vector<TemplateURL*>* t_urls,
1216 size_t* default_search_provider_index) { 1216 size_t* default_search_provider_index) {
1217 // If there is a set of search engines in the preferences file, it overrides 1217 // If there is a set of search engines in the preferences file, it overrides
1218 // the built-in set. 1218 // the built-in set.
1219 *default_search_provider_index = 0; 1219 *default_search_provider_index = 0;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size) { 1288 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size) {
1289 if (GetEngineType(template_url.url()) == SEARCH_ENGINE_GOOGLE) { 1289 if (GetEngineType(template_url.url()) == SEARCH_ENGINE_GOOGLE) {
1290 return GURL((size == LOGO_200_PERCENT) ? 1290 return GURL((size == LOGO_200_PERCENT) ?
1291 google_logos.logo_200_percent_url : 1291 google_logos.logo_200_percent_url :
1292 google_logos.logo_100_percent_url); 1292 google_logos.logo_100_percent_url);
1293 } 1293 }
1294 return GURL(); 1294 return GURL();
1295 } 1295 }
1296 1296
1297 } // namespace TemplateURLPrepopulateData 1297 } // namespace TemplateURLPrepopulateData
OLDNEW
« no previous file with comments | « chrome/browser/process_singleton_linux.cc ('k') | chrome/browser/search_engines/template_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698