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

Side by Side Diff: chrome/browser/prefs/chrome_pref_service_factory.cc

Issue 2598033004: Remove old default search preferences. (Closed)
Patch Set: Updated histograms.xml Created 3 years, 12 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
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/prefs/chrome_command_line_pref_store.h> 5 #include <chrome/browser/prefs/chrome_command_line_pref_store.h>
6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 29 matching lines...) Expand all
40 #include "components/prefs/default_pref_store.h" 40 #include "components/prefs/default_pref_store.h"
41 #include "components/prefs/json_pref_store.h" 41 #include "components/prefs/json_pref_store.h"
42 #include "components/prefs/pref_filter.h" 42 #include "components/prefs/pref_filter.h"
43 #include "components/prefs/pref_notifier_impl.h" 43 #include "components/prefs/pref_notifier_impl.h"
44 #include "components/prefs/pref_registry.h" 44 #include "components/prefs/pref_registry.h"
45 #include "components/prefs/pref_registry_simple.h" 45 #include "components/prefs/pref_registry_simple.h"
46 #include "components/prefs/pref_service.h" 46 #include "components/prefs/pref_service.h"
47 #include "components/prefs/pref_store.h" 47 #include "components/prefs/pref_store.h"
48 #include "components/prefs/pref_value_store.h" 48 #include "components/prefs/pref_value_store.h"
49 #include "components/search_engines/default_search_manager.h" 49 #include "components/search_engines/default_search_manager.h"
50 #include "components/search_engines/default_search_pref_migration.h"
51 #include "components/search_engines/search_engines_pref_names.h" 50 #include "components/search_engines/search_engines_pref_names.h"
52 #include "components/signin/core/common/signin_pref_names.h" 51 #include "components/signin/core/common/signin_pref_names.h"
53 #include "components/sync/base/model_type.h" 52 #include "components/sync/base/model_type.h"
54 #include "components/sync/base/pref_names.h" 53 #include "components/sync/base/pref_names.h"
55 #include "components/sync_preferences/pref_model_associator.h" 54 #include "components/sync_preferences/pref_model_associator.h"
56 #include "components/sync_preferences/pref_service_syncable.h" 55 #include "components/sync_preferences/pref_service_syncable.h"
57 #include "components/sync_preferences/pref_service_syncable_factory.h" 56 #include "components/sync_preferences/pref_service_syncable_factory.h"
58 #include "components/user_prefs/tracked/pref_names.h" 57 #include "components/user_prefs/tracked/pref_names.h"
59 #include "content/public/browser/browser_context.h" 58 #include "content/public/browser/browser_context.h"
60 #include "content/public/browser/browser_thread.h" 59 #include "content/public/browser/browser_thread.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 PrefHashFilter::ENFORCE_ON_LOAD, 139 PrefHashFilter::ENFORCE_ON_LOAD,
141 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, 140 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
142 PrefHashFilter::VALUE_PERSONAL 141 PrefHashFilter::VALUE_PERSONAL
143 }, 142 },
144 { 143 {
145 7, prefs::kSearchProviderOverrides, 144 7, prefs::kSearchProviderOverrides,
146 PrefHashFilter::ENFORCE_ON_LOAD, 145 PrefHashFilter::ENFORCE_ON_LOAD,
147 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, 146 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
148 PrefHashFilter::VALUE_IMPERSONAL 147 PrefHashFilter::VALUE_IMPERSONAL
149 }, 148 },
149 // Deprecated, will be removed several releases after M57.
150 { 150 {
151 8, prefs::kDefaultSearchProviderSearchURL, 151 8, prefs::kDefaultSearchProviderSearchURL,
gab 2016/12/23 17:26:26 If they're no longer migrated, why do they still n
Alexander Yashkin 2016/12/23 20:28:13 Done
152 PrefHashFilter::ENFORCE_ON_LOAD, 152 PrefHashFilter::ENFORCE_ON_LOAD,
153 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, 153 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
154 PrefHashFilter::VALUE_IMPERSONAL 154 PrefHashFilter::VALUE_IMPERSONAL
155 }, 155 },
156 // Deprecated, will be removed several releases after M57.
156 { 157 {
157 9, prefs::kDefaultSearchProviderKeyword, 158 9, prefs::kDefaultSearchProviderKeyword,
158 PrefHashFilter::ENFORCE_ON_LOAD, 159 PrefHashFilter::ENFORCE_ON_LOAD,
159 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, 160 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
160 PrefHashFilter::VALUE_IMPERSONAL 161 PrefHashFilter::VALUE_IMPERSONAL
161 }, 162 },
163 // Deprecated, will be removed several releases after M57.
162 { 164 {
163 10, prefs::kDefaultSearchProviderName, 165 10, prefs::kDefaultSearchProviderName,
164 PrefHashFilter::ENFORCE_ON_LOAD, 166 PrefHashFilter::ENFORCE_ON_LOAD,
165 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, 167 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
166 PrefHashFilter::VALUE_IMPERSONAL 168 PrefHashFilter::VALUE_IMPERSONAL
167 }, 169 },
168 #if !defined(OS_ANDROID) 170 #if !defined(OS_ANDROID)
169 { 171 {
170 11, prefs::kPinnedTabs, 172 11, prefs::kPinnedTabs,
171 PrefHashFilter::ENFORCE_ON_LOAD, 173 PrefHashFilter::ENFORCE_ON_LOAD,
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 CreateProfilePrefStoreManager(profile_path) 513 CreateProfilePrefStoreManager(profile_path)
512 ->CreateProfilePrefStore(pref_io_task_runner, 514 ->CreateProfilePrefStore(pref_io_task_runner,
513 start_sync_flare_for_prefs, 515 start_sync_flare_for_prefs,
514 validation_delegate)); 516 validation_delegate));
515 PrepareFactory(&factory, profile_path, policy_service, 517 PrepareFactory(&factory, profile_path, policy_service,
516 supervised_user_settings, user_pref_store, extension_prefs, 518 supervised_user_settings, user_pref_store, extension_prefs,
517 async); 519 async);
518 std::unique_ptr<sync_preferences::PrefServiceSyncable> pref_service = 520 std::unique_ptr<sync_preferences::PrefServiceSyncable> pref_service =
519 factory.CreateSyncable(pref_registry.get()); 521 factory.CreateSyncable(pref_registry.get());
520 522
521 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get());
522
523 return pref_service; 523 return pref_service;
524 } 524 }
525 525
526 void DisableDomainCheckForTesting() { 526 void DisableDomainCheckForTesting() {
527 #if defined(OS_WIN) 527 #if defined(OS_WIN)
528 g_disable_domain_check_for_testing = true; 528 g_disable_domain_check_for_testing = true;
529 #endif // OS_WIN 529 #endif // OS_WIN
530 } 530 }
531 531
532 bool InitializePrefsFromMasterPrefs( 532 bool InitializePrefsFromMasterPrefs(
533 const base::FilePath& profile_path, 533 const base::FilePath& profile_path,
534 const base::DictionaryValue& master_prefs) { 534 const base::DictionaryValue& master_prefs) {
535 return CreateProfilePrefStoreManager(profile_path) 535 return CreateProfilePrefStoreManager(profile_path)
536 ->InitializePrefsFromMasterPrefs(master_prefs); 536 ->InitializePrefsFromMasterPrefs(master_prefs);
537 } 537 }
538 538
539 base::Time GetResetTime(Profile* profile) { 539 base::Time GetResetTime(Profile* profile) {
540 return ProfilePrefStoreManager::GetResetTime(profile->GetPrefs()); 540 return ProfilePrefStoreManager::GetResetTime(profile->GetPrefs());
541 } 541 }
542 542
543 void ClearResetTime(Profile* profile) { 543 void ClearResetTime(Profile* profile) {
544 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); 544 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs());
545 } 545 }
546 546
547 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 547 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
548 ProfilePrefStoreManager::RegisterProfilePrefs(registry); 548 ProfilePrefStoreManager::RegisterProfilePrefs(registry);
549 } 549 }
550 550
551 } // namespace chrome_prefs 551 } // namespace chrome_prefs
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698