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/prefs/chrome_pref_service_factory.h" | 5 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/prefs/command_line_pref_store.h" | 24 #include "chrome/browser/prefs/command_line_pref_store.h" |
25 #include "chrome/browser/prefs/profile_pref_store_manager.h" | 25 #include "chrome/browser/prefs/profile_pref_store_manager.h" |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/sync/glue/sync_start_util.h" | 27 #include "chrome/browser/sync/glue/sync_start_util.h" |
28 #include "chrome/browser/ui/profile_error_dialog.h" | 28 #include "chrome/browser/ui/profile_error_dialog.h" |
29 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
31 #include "chrome/grit/chromium_strings.h" | 31 #include "chrome/grit/chromium_strings.h" |
32 #include "chrome/grit/generated_resources.h" | 32 #include "chrome/grit/generated_resources.h" |
33 #include "components/component_updater/pref_names.h" | 33 #include "components/component_updater/pref_names.h" |
| 34 #include "components/policy/core/browser/browser_policy_connector.h" |
| 35 #include "components/policy/core/browser/configuration_policy_pref_store.h" |
34 #include "components/pref_registry/pref_registry_syncable.h" | 36 #include "components/pref_registry/pref_registry_syncable.h" |
35 #include "components/prefs/default_pref_store.h" | 37 #include "components/prefs/default_pref_store.h" |
36 #include "components/prefs/json_pref_store.h" | 38 #include "components/prefs/json_pref_store.h" |
37 #include "components/prefs/pref_filter.h" | 39 #include "components/prefs/pref_filter.h" |
38 #include "components/prefs/pref_notifier_impl.h" | 40 #include "components/prefs/pref_notifier_impl.h" |
39 #include "components/prefs/pref_registry.h" | 41 #include "components/prefs/pref_registry.h" |
40 #include "components/prefs/pref_registry_simple.h" | 42 #include "components/prefs/pref_registry_simple.h" |
41 #include "components/prefs/pref_service.h" | 43 #include "components/prefs/pref_service.h" |
42 #include "components/prefs/pref_store.h" | 44 #include "components/prefs/pref_store.h" |
43 #include "components/prefs/pref_value_store.h" | 45 #include "components/prefs/pref_value_store.h" |
44 #include "components/search_engines/default_search_manager.h" | 46 #include "components/search_engines/default_search_manager.h" |
45 #include "components/search_engines/default_search_pref_migration.h" | 47 #include "components/search_engines/default_search_pref_migration.h" |
46 #include "components/search_engines/search_engines_pref_names.h" | 48 #include "components/search_engines/search_engines_pref_names.h" |
47 #include "components/signin/core/common/signin_pref_names.h" | 49 #include "components/signin/core/common/signin_pref_names.h" |
48 #include "components/sync_driver/pref_names.h" | 50 #include "components/sync_driver/pref_names.h" |
49 #include "components/syncable_prefs/pref_model_associator.h" | 51 #include "components/syncable_prefs/pref_model_associator.h" |
50 #include "components/syncable_prefs/pref_service_syncable.h" | 52 #include "components/syncable_prefs/pref_service_syncable.h" |
51 #include "components/syncable_prefs/pref_service_syncable_factory.h" | 53 #include "components/syncable_prefs/pref_service_syncable_factory.h" |
52 #include "components/user_prefs/tracked/pref_names.h" | 54 #include "components/user_prefs/tracked/pref_names.h" |
53 #include "content/public/browser/browser_context.h" | 55 #include "content/public/browser/browser_context.h" |
54 #include "content/public/browser/browser_thread.h" | 56 #include "content/public/browser/browser_thread.h" |
55 #include "grit/browser_resources.h" | 57 #include "grit/browser_resources.h" |
56 #include "sync/internal_api/public/base/model_type.h" | 58 #include "sync/internal_api/public/base/model_type.h" |
57 #include "ui/base/resource/resource_bundle.h" | 59 #include "ui/base/resource/resource_bundle.h" |
58 | 60 |
59 #if defined(ENABLE_CONFIGURATION_POLICY) | |
60 #include "components/policy/core/browser/browser_policy_connector.h" | |
61 #include "components/policy/core/browser/configuration_policy_pref_store.h" | |
62 #endif | |
63 | |
64 #if defined(ENABLE_EXTENSIONS) | 61 #if defined(ENABLE_EXTENSIONS) |
65 #include "extensions/browser/pref_names.h" | 62 #include "extensions/browser/pref_names.h" |
66 #endif | 63 #endif |
67 | 64 |
68 #if defined(ENABLE_SUPERVISED_USERS) | 65 #if defined(ENABLE_SUPERVISED_USERS) |
69 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" | 66 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" |
70 #endif | 67 #endif |
71 | 68 |
72 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
73 #include "base/win/win_util.h" | 70 #include "base/win/win_util.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 g_browser_process->local_state())); | 416 g_browser_process->local_state())); |
420 } | 417 } |
421 | 418 |
422 void PrepareFactory( | 419 void PrepareFactory( |
423 syncable_prefs::PrefServiceSyncableFactory* factory, | 420 syncable_prefs::PrefServiceSyncableFactory* factory, |
424 policy::PolicyService* policy_service, | 421 policy::PolicyService* policy_service, |
425 SupervisedUserSettingsService* supervised_user_settings, | 422 SupervisedUserSettingsService* supervised_user_settings, |
426 scoped_refptr<PersistentPrefStore> user_pref_store, | 423 scoped_refptr<PersistentPrefStore> user_pref_store, |
427 const scoped_refptr<PrefStore>& extension_prefs, | 424 const scoped_refptr<PrefStore>& extension_prefs, |
428 bool async) { | 425 bool async) { |
429 #if defined(ENABLE_CONFIGURATION_POLICY) | |
430 policy::BrowserPolicyConnector* policy_connector = | 426 policy::BrowserPolicyConnector* policy_connector = |
431 g_browser_process->browser_policy_connector(); | 427 g_browser_process->browser_policy_connector(); |
432 factory->SetManagedPolicies(policy_service, policy_connector); | 428 factory->SetManagedPolicies(policy_service, policy_connector); |
433 factory->SetRecommendedPolicies(policy_service, policy_connector); | 429 factory->SetRecommendedPolicies(policy_service, policy_connector); |
434 #endif // ENABLE_CONFIGURATION_POLICY | |
435 | 430 |
436 #if defined(ENABLE_SUPERVISED_USERS) | 431 #if defined(ENABLE_SUPERVISED_USERS) |
437 if (supervised_user_settings) { | 432 if (supervised_user_settings) { |
438 scoped_refptr<PrefStore> supervised_user_prefs = make_scoped_refptr( | 433 scoped_refptr<PrefStore> supervised_user_prefs = make_scoped_refptr( |
439 new SupervisedUserPrefStore(supervised_user_settings)); | 434 new SupervisedUserPrefStore(supervised_user_settings)); |
440 // TODO(bauerb): Temporary CHECK while investigating | 435 // TODO(bauerb): Temporary CHECK while investigating |
441 // https://crbug.com/425785. Remove when that bug is fixed. | 436 // https://crbug.com/425785. Remove when that bug is fixed. |
442 CHECK(async || supervised_user_prefs->IsInitializationComplete()); | 437 CHECK(async || supervised_user_prefs->IsInitializationComplete()); |
443 factory->set_supervised_user_prefs(supervised_user_prefs); | 438 factory->set_supervised_user_prefs(supervised_user_prefs); |
444 } | 439 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 550 |
556 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 551 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
557 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 552 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
558 } | 553 } |
559 | 554 |
560 void RegisterPrefs(PrefRegistrySimple* registry) { | 555 void RegisterPrefs(PrefRegistrySimple* registry) { |
561 ProfilePrefStoreManager::RegisterPrefs(registry); | 556 ProfilePrefStoreManager::RegisterPrefs(registry); |
562 } | 557 } |
563 | 558 |
564 } // namespace chrome_prefs | 559 } // namespace chrome_prefs |
OLD | NEW |