OLD | NEW |
---|---|
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 3263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3274 PrefService::UNSYNCABLE_PREF); | 3274 PrefService::UNSYNCABLE_PREF); |
3275 // Obsolete pref, for migration. | 3275 // Obsolete pref, for migration. |
3276 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, | 3276 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, |
3277 -1, | 3277 -1, |
3278 PrefService::UNSYNCABLE_PREF); | 3278 PrefService::UNSYNCABLE_PREF); |
3279 } | 3279 } |
3280 | 3280 |
3281 int GetDataVersion(PrefService* prefs) { | 3281 int GetDataVersion(PrefService* prefs) { |
3282 // Increment this if you change the above data in ways that mean users with | 3282 // Increment this if you change the above data in ways that mean users with |
3283 // existing data should get a new version. | 3283 // existing data should get a new version. |
3284 const int kCurrentDataVersion = 39; | 3284 const int kCurrentDataVersion = 40; |
3285 // Allow tests to override the local version. | 3285 // Allow tests to override the local version. |
3286 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? | 3286 return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? |
3287 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : | 3287 prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : |
3288 kCurrentDataVersion; | 3288 kCurrentDataVersion; |
3289 } | 3289 } |
3290 | 3290 |
3291 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, | 3291 TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, |
3292 const string16& name, | 3292 const string16& name, |
3293 const string16& keyword, | 3293 const string16& keyword, |
3294 const base::StringPiece& search_url, | 3294 const base::StringPiece& search_url, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3435 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { | 3435 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { |
3436 GURL engine_url(kAllEngines[i]->search_url); | 3436 GURL engine_url(kAllEngines[i]->search_url); |
3437 if (engine_url.is_valid() && (origin == engine_url.GetOrigin())) | 3437 if (engine_url.is_valid() && (origin == engine_url.GetOrigin())) |
3438 return kAllEngines[i]->type; | 3438 return kAllEngines[i]->type; |
3439 } | 3439 } |
3440 | 3440 |
3441 return SEARCH_ENGINE_OTHER; | 3441 return SEARCH_ENGINE_OTHER; |
3442 } | 3442 } |
3443 | 3443 |
3444 } // namespace TemplateURLPrepopulateData | 3444 } // namespace TemplateURLPrepopulateData |
3445 | |
msw
2012/06/13 22:39:33
nit: remove blank line at the end.
| |
OLD | NEW |