| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/search_engines/template_url_prepopulate_data.h" | 5 #include "components/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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 given_url, prepopulated_url, | 1177 given_url, prepopulated_url, |
| 1178 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 1178 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 } // namespace | 1181 } // namespace |
| 1182 | 1182 |
| 1183 | 1183 |
| 1184 // Global functions ----------------------------------------------------------- | 1184 // Global functions ----------------------------------------------------------- |
| 1185 | 1185 |
| 1186 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 1186 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 1187 registry->RegisterIntegerPref( | 1187 registry->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown); |
| 1188 prefs::kCountryIDAtInstall, | 1188 registry->RegisterListPref(prefs::kSearchProviderOverrides); |
| 1189 kCountryIDUnknown, | 1189 registry->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, -1); |
| 1190 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 1191 registry->RegisterListPref(prefs::kSearchProviderOverrides, | |
| 1192 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 1193 registry->RegisterIntegerPref( | |
| 1194 prefs::kSearchProviderOverridesVersion, | |
| 1195 -1, | |
| 1196 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 1197 } | 1190 } |
| 1198 | 1191 |
| 1199 int GetDataVersion(PrefService* prefs) { | 1192 int GetDataVersion(PrefService* prefs) { |
| 1200 // Allow tests to override the local version. | 1193 // Allow tests to override the local version. |
| 1201 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? | 1194 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? |
| 1202 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : | 1195 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : |
| 1203 kCurrentDataVersion; | 1196 kCurrentDataVersion; |
| 1204 } | 1197 } |
| 1205 | 1198 |
| 1206 ScopedVector<TemplateURLData> GetPrepopulatedEngines( | 1199 ScopedVector<TemplateURLData> GetPrepopulatedEngines( |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 for (size_t j = 0; j < kAllEngines[i]->alternate_urls_size; ++j) { | 1271 for (size_t j = 0; j < kAllEngines[i]->alternate_urls_size; ++j) { |
| 1279 if (SameDomain(url, GURL(kAllEngines[i]->alternate_urls[j]))) | 1272 if (SameDomain(url, GURL(kAllEngines[i]->alternate_urls[j]))) |
| 1280 return kAllEngines[i]->type; | 1273 return kAllEngines[i]->type; |
| 1281 } | 1274 } |
| 1282 } | 1275 } |
| 1283 | 1276 |
| 1284 return SEARCH_ENGINE_OTHER; | 1277 return SEARCH_ENGINE_OTHER; |
| 1285 } | 1278 } |
| 1286 | 1279 |
| 1287 } // namespace TemplateURLPrepopulateData | 1280 } // namespace TemplateURLPrepopulateData |
| OLD | NEW |