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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix. And rebase Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 3323 matching lines...) Expand 10 before | Expand all | Expand 10 after
3334 default: // Unhandled location 3334 default: // Unhandled location
3335 END_UNHANDLED_COUNTRIES(def, ault) 3335 END_UNHANDLED_COUNTRIES(def, ault)
3336 } 3336 }
3337 } 3337 }
3338 3338
3339 } // namespace 3339 } // namespace
3340 3340
3341 namespace TemplateURLPrepopulateData { 3341 namespace TemplateURLPrepopulateData {
3342 3342
3343 void RegisterUserPrefs(PrefService* prefs) { 3343 void RegisterUserPrefs(PrefService* prefs) {
3344 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall, kCountryIDUnknown); 3344 prefs->RegisterIntegerPref(prefs::kCountryIDAtInstall,
3345 prefs->RegisterListPref(prefs::kSearchProviderOverrides); 3345 kCountryIDUnknown,
3346 prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion, -1); 3346 PrefService::UNSYNCABLE_PREF);
3347 prefs->RegisterListPref(prefs::kSearchProviderOverrides,
3348 PrefService::UNSYNCABLE_PREF);
3349 prefs->RegisterIntegerPref(prefs::kSearchProviderOverridesVersion,
3350 -1,
3351 PrefService::UNSYNCABLE_PREF);
3347 // Obsolete pref, for migration. 3352 // Obsolete pref, for migration.
3348 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall, -1); 3353 prefs->RegisterIntegerPref(prefs::kGeoIDAtInstall,
3354 -1,
3355 PrefService::UNSYNCABLE_PREF);
3349 } 3356 }
3350 3357
3351 int GetDataVersion(PrefService* prefs) { 3358 int GetDataVersion(PrefService* prefs) {
3352 // Increment this if you change the above data in ways that mean users with 3359 // Increment this if you change the above data in ways that mean users with
3353 // existing data should get a new version. 3360 // existing data should get a new version.
3354 const int kCurrentDataVersion = 33; 3361 const int kCurrentDataVersion = 33;
3355 if (!prefs) 3362 if (!prefs)
3356 return kCurrentDataVersion; 3363 return kCurrentDataVersion;
3357 // If a version number exist in the preferences file, it overrides the 3364 // If a version number exist in the preferences file, it overrides the
3358 // version of the built-in data. 3365 // version of the built-in data.
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
3565 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { 3572 for (size_t i = 0; i < arraysize(kAllEngines); ++i) {
3566 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); 3573 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url));
3567 GURL url(url_utf8_string); 3574 GURL url(url_utf8_string);
3568 if (origin_to_find == url.GetOrigin()) 3575 if (origin_to_find == url.GetOrigin())
3569 return kAllEngines[i]->logo_id; 3576 return kAllEngines[i]->logo_id;
3570 } 3577 }
3571 return kNoSearchEngineLogo; 3578 return kNoSearchEngineLogo;
3572 } 3579 }
3573 3580
3574 } // namespace TemplateURLPrepopulateData 3581 } // namespace TemplateURLPrepopulateData
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_model.cc ('k') | chrome/browser/sync/abstract_profile_sync_service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698