OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown); | 3134 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown); |
3135 prefs->RegisterListPref(prefs::kSearchProviderOverrides); | 3135 prefs->RegisterListPref(prefs::kSearchProviderOverrides); |
3136 prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, -1); | 3136 prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, -1); |
3137 // Obsolete pref, for migration. | 3137 // Obsolete pref, for migration. |
3138 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, -1); | 3138 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, -1); |
3139 } | 3139 } |
3140 | 3140 |
3141 int GetDataVersion(PrefService* prefs) { | 3141 int GetDataVersion(PrefService* prefs) { |
3142 // Increment this if you change the above data in ways that mean users with | 3142 // Increment this if you change the above data in ways that mean users with |
3143 // existing data should get a new version. | 3143 // existing data should get a new version. |
3144 const int kCurrentDataVersion = 28; | 3144 const int kCurrentDataVersion = 29; |
3145 if (!prefs) | 3145 if (!prefs) |
3146 return kCurrentDataVersion; | 3146 return kCurrentDataVersion; |
3147 // If a version number exist in the preferences file, it overrides the | 3147 // If a version number exist in the preferences file, it overrides the |
3148 // version of the built-in data. | 3148 // version of the built-in data. |
3149 int version = | 3149 int version = |
3150 prefs->GetInteger(prefs::kSearchProviderOverridesVersion); | 3150 prefs->GetInteger(prefs::kSearchProviderOverridesVersion); |
3151 return (version >= 0) ? version : kCurrentDataVersion; | 3151 return (version >= 0) ? version : kCurrentDataVersion; |
3152 } | 3152 } |
3153 | 3153 |
3154 TemplateURL* MakePrepopulatedTemplateURL(const wchar_t* name, | 3154 TemplateURL* MakePrepopulatedTemplateURL(const wchar_t* name, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 engines[i]->suggest_url, | 3259 engines[i]->suggest_url, |
3260 engines[i]->encoding, | 3260 engines[i]->encoding, |
3261 engines[i]->search_engine_type, | 3261 engines[i]->search_engine_type, |
3262 engines[i]->logo_id, | 3262 engines[i]->logo_id, |
3263 engines[i]->id); | 3263 engines[i]->id); |
3264 t_urls->push_back(turl); | 3264 t_urls->push_back(turl); |
3265 } | 3265 } |
3266 } | 3266 } |
3267 | 3267 |
3268 } // namespace TemplateURLPrepopulateData | 3268 } // namespace TemplateURLPrepopulateData |
OLD | NEW |