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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 }; 1081 };
1082 1082
1083 const LogoURLs google_logos = { 1083 const LogoURLs google_logos = {
1084 "https://www.google.com/images/chrome_search/google_logo.png", 1084 "https://www.google.com/images/chrome_search/google_logo.png",
1085 "https://www.google.com/images/chrome_search/google_logo_2x.png", 1085 "https://www.google.com/images/chrome_search/google_logo_2x.png",
1086 }; 1086 };
1087 1087
1088 1088
1089 //////////////////////////////////////////////////////////////////////////////// 1089 ////////////////////////////////////////////////////////////////////////////////
1090 1090
1091 void RegisterUserPrefs(PrefService* prefs) { 1091 void RegisterUserPrefs(PrefServiceSyncable* prefs) {
1092 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, 1092 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall,
1093 kCountryIDUnknown, 1093 kCountryIDUnknown,
1094 PrefService::UNSYNCABLE_PREF); 1094 PrefServiceSyncable::UNSYNCABLE_PREF);
1095 prefs->RegisterListPref(prefs::kSearchProviderOverrides, 1095 prefs->RegisterListPref(prefs::kSearchProviderOverrides,
1096 PrefService::UNSYNCABLE_PREF); 1096 PrefServiceSyncable::UNSYNCABLE_PREF);
1097 prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, 1097 prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion,
1098 -1, 1098 -1,
1099 PrefService::UNSYNCABLE_PREF); 1099 PrefServiceSyncable::UNSYNCABLE_PREF);
1100 // Obsolete pref, for migration. 1100 // Obsolete pref, for migration.
1101 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, 1101 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall,
1102 -1, 1102 -1,
1103 PrefService::UNSYNCABLE_PREF); 1103 PrefServiceSyncable::UNSYNCABLE_PREF);
1104 } 1104 }
1105 1105
1106 int GetDataVersion(PrefService* prefs) { 1106 int GetDataVersion(PrefService* prefs) {
1107 // Allow tests to override the local version. 1107 // Allow tests to override the local version.
1108 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? 1108 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ?
1109 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : 1109 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) :
1110 kCurrentDataVersion; 1110 kCurrentDataVersion;
1111 } 1111 }
1112 1112
1113 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, 1113 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size) { 1281 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size) {
1282 if (GetEngineType(template_url.url()) == SEARCH_ENGINE_GOOGLE) { 1282 if (GetEngineType(template_url.url()) == SEARCH_ENGINE_GOOGLE) {
1283 return GURL((size == LOGO_200_PERCENT) ? 1283 return GURL((size == LOGO_200_PERCENT) ?
1284 google_logos.logo_200_percent_url : 1284 google_logos.logo_200_percent_url :
1285 google_logos.logo_100_percent_url); 1285 google_logos.logo_100_percent_url);
1286 } 1286 }
1287 return GURL(); 1287 return GURL();
1288 } 1288 }
1289 1289
1290 } // namespace TemplateURLPrepopulateData 1290 } // namespace TemplateURLPrepopulateData
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698