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

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

Issue 2598033004: Remove old default search preferences. (Closed)
Patch Set: Fixed after review, round 2 Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/prefs/tracked/pref_hash_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 },
150 {
151 8, prefs::kDefaultSearchProviderSearchURL,
152 PrefHashFilter::ENFORCE_ON_LOAD,
153 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
154 PrefHashFilter::VALUE_IMPERSONAL
155 },
156 {
157 9, prefs::kDefaultSearchProviderKeyword,
158 PrefHashFilter::ENFORCE_ON_LOAD,
159 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
160 PrefHashFilter::VALUE_IMPERSONAL
161 },
162 {
163 10, prefs::kDefaultSearchProviderName,
164 PrefHashFilter::ENFORCE_ON_LOAD,
165 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
166 PrefHashFilter::VALUE_IMPERSONAL
167 },
168 #if !defined(OS_ANDROID) 149 #if !defined(OS_ANDROID)
169 { 150 {
170 11, prefs::kPinnedTabs, 151 11, prefs::kPinnedTabs,
171 PrefHashFilter::ENFORCE_ON_LOAD, 152 PrefHashFilter::ENFORCE_ON_LOAD,
172 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, 153 PrefHashFilter::TRACKING_STRATEGY_ATOMIC,
173 PrefHashFilter::VALUE_IMPERSONAL 154 PrefHashFilter::VALUE_IMPERSONAL
174 }, 155 },
175 #endif 156 #endif
176 { 157 {
177 14, DefaultSearchManager::kDefaultSearchProviderDataPrefName, 158 14, DefaultSearchManager::kDefaultSearchProviderDataPrefName,
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 CreateProfilePrefStoreManager(profile_path) 492 CreateProfilePrefStoreManager(profile_path)
512 ->CreateProfilePrefStore(pref_io_task_runner, 493 ->CreateProfilePrefStore(pref_io_task_runner,
513 start_sync_flare_for_prefs, 494 start_sync_flare_for_prefs,
514 validation_delegate)); 495 validation_delegate));
515 PrepareFactory(&factory, profile_path, policy_service, 496 PrepareFactory(&factory, profile_path, policy_service,
516 supervised_user_settings, user_pref_store, extension_prefs, 497 supervised_user_settings, user_pref_store, extension_prefs,
517 async); 498 async);
518 std::unique_ptr<sync_preferences::PrefServiceSyncable> pref_service = 499 std::unique_ptr<sync_preferences::PrefServiceSyncable> pref_service =
519 factory.CreateSyncable(pref_registry.get()); 500 factory.CreateSyncable(pref_registry.get());
520 501
521 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get());
522
523 return pref_service; 502 return pref_service;
524 } 503 }
525 504
526 void DisableDomainCheckForTesting() { 505 void DisableDomainCheckForTesting() {
527 #if defined(OS_WIN) 506 #if defined(OS_WIN)
528 g_disable_domain_check_for_testing = true; 507 g_disable_domain_check_for_testing = true;
529 #endif // OS_WIN 508 #endif // OS_WIN
530 } 509 }
531 510
532 bool InitializePrefsFromMasterPrefs( 511 bool InitializePrefsFromMasterPrefs(
533 const base::FilePath& profile_path, 512 const base::FilePath& profile_path,
534 const base::DictionaryValue& master_prefs) { 513 const base::DictionaryValue& master_prefs) {
535 return CreateProfilePrefStoreManager(profile_path) 514 return CreateProfilePrefStoreManager(profile_path)
536 ->InitializePrefsFromMasterPrefs(master_prefs); 515 ->InitializePrefsFromMasterPrefs(master_prefs);
537 } 516 }
538 517
539 base::Time GetResetTime(Profile* profile) { 518 base::Time GetResetTime(Profile* profile) {
540 return ProfilePrefStoreManager::GetResetTime(profile->GetPrefs()); 519 return ProfilePrefStoreManager::GetResetTime(profile->GetPrefs());
541 } 520 }
542 521
543 void ClearResetTime(Profile* profile) { 522 void ClearResetTime(Profile* profile) {
544 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); 523 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs());
545 } 524 }
546 525
547 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 526 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
548 ProfilePrefStoreManager::RegisterProfilePrefs(registry); 527 ProfilePrefStoreManager::RegisterProfilePrefs(registry);
549 } 528 }
550 529
551 } // namespace chrome_prefs 530 } // namespace chrome_prefs
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/tracked/pref_hash_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698