| 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 #ifndef CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class DictionaryValue; | 13 class DictionaryValue; |
| 14 class FilePath; | 14 class FilePath; |
| 15 class SequencedTaskRunner; | 15 class SequencedTaskRunner; |
| 16 class Time; | 16 class Time; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace policy { | 19 namespace policy { |
| 20 class PolicyService; | 20 class PolicyService; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace prefs { | 23 namespace prefs { |
| 24 namespace mojom { | 24 namespace mojom { |
| 25 class TrackedPreferenceValidationDelegate; | 25 class TrackedPreferenceValidationDelegate; |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace service_manager { |
| 30 class Connector; |
| 31 } |
| 32 |
| 29 namespace sync_preferences { | 33 namespace sync_preferences { |
| 30 class PrefServiceSyncable; | 34 class PrefServiceSyncable; |
| 31 } | 35 } |
| 32 | 36 |
| 33 namespace user_prefs { | 37 namespace user_prefs { |
| 34 class PrefRegistrySyncable; | 38 class PrefRegistrySyncable; |
| 35 } | 39 } |
| 36 | 40 |
| 37 class PrefRegistry; | 41 class PrefRegistry; |
| 38 class PrefService; | 42 class PrefService; |
| 39 | 43 |
| 40 class PrefStore; | 44 class PrefStore; |
| 41 class Profile; | 45 class Profile; |
| 42 class SupervisedUserSettingsService; | 46 class SupervisedUserSettingsService; |
| 47 class TrackedPreferenceValidationDelegate; |
| 43 | 48 |
| 44 namespace chrome_prefs { | 49 namespace chrome_prefs { |
| 45 | 50 |
| 46 namespace internals { | 51 namespace internals { |
| 47 | 52 |
| 48 extern const char kSettingsEnforcementTrialName[]; | 53 extern const char kSettingsEnforcementTrialName[]; |
| 49 extern const char kSettingsEnforcementGroupNoEnforcement[]; | 54 extern const char kSettingsEnforcementGroupNoEnforcement[]; |
| 50 extern const char kSettingsEnforcementGroupEnforceAlways[]; | 55 extern const char kSettingsEnforcementGroupEnforceAlways[]; |
| 51 extern const char kSettingsEnforcementGroupEnforceAlwaysWithDSE[]; | 56 extern const char kSettingsEnforcementGroupEnforceAlwaysWithDSE[]; |
| 52 extern const char kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE[]; | 57 extern const char kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE[]; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 76 bool async); | 81 bool async); |
| 77 | 82 |
| 78 std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs( | 83 std::unique_ptr<sync_preferences::PrefServiceSyncable> CreateProfilePrefs( |
| 79 const base::FilePath& pref_filename, | 84 const base::FilePath& pref_filename, |
| 80 base::SequencedTaskRunner* pref_io_task_runner, | 85 base::SequencedTaskRunner* pref_io_task_runner, |
| 81 prefs::mojom::TrackedPreferenceValidationDelegate* validation_delegate, | 86 prefs::mojom::TrackedPreferenceValidationDelegate* validation_delegate, |
| 82 policy::PolicyService* policy_service, | 87 policy::PolicyService* policy_service, |
| 83 SupervisedUserSettingsService* supervised_user_settings, | 88 SupervisedUserSettingsService* supervised_user_settings, |
| 84 const scoped_refptr<PrefStore>& extension_prefs, | 89 const scoped_refptr<PrefStore>& extension_prefs, |
| 85 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, | 90 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, |
| 86 bool async); | 91 bool async, |
| 92 service_manager::Connector* connector); |
| 87 | 93 |
| 88 // Call before startup tasks kick in to ignore the presence of a domain when | 94 // Call before startup tasks kick in to ignore the presence of a domain when |
| 89 // determining the active SettingsEnforcement group. For testing only. | 95 // determining the active SettingsEnforcement group. For testing only. |
| 90 void DisableDomainCheckForTesting(); | 96 void DisableDomainCheckForTesting(); |
| 91 | 97 |
| 92 // Initializes the preferences for the profile at |profile_path| with the | 98 // Initializes the preferences for the profile at |profile_path| with the |
| 93 // preference values in |master_prefs|. Returns true on success. | 99 // preference values in |master_prefs|. Returns true on success. |
| 94 bool InitializePrefsFromMasterPrefs( | 100 bool InitializePrefsFromMasterPrefs( |
| 95 const base::FilePath& profile_path, | 101 const base::FilePath& profile_path, |
| 96 std::unique_ptr<base::DictionaryValue> master_prefs); | 102 std::unique_ptr<base::DictionaryValue> master_prefs); |
| 97 | 103 |
| 98 // Retrieves the time of the last preference reset event, if any, for the | 104 // Retrieves the time of the last preference reset event, if any, for the |
| 99 // provided profile. If no reset has occurred, returns a null |Time|. | 105 // provided profile. If no reset has occurred, returns a null |Time|. |
| 100 base::Time GetResetTime(Profile* profile); | 106 base::Time GetResetTime(Profile* profile); |
| 101 | 107 |
| 102 // Clears the time of the last preference reset event, if any, for the provided | 108 // Clears the time of the last preference reset event, if any, for the provided |
| 103 // profile. | 109 // profile. |
| 104 void ClearResetTime(Profile* profile); | 110 void ClearResetTime(Profile* profile); |
| 105 | 111 |
| 106 // Register user prefs used by chrome preference system. | 112 // Register user prefs used by chrome preference system. |
| 107 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 113 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 108 | 114 |
| 109 } // namespace chrome_prefs | 115 } // namespace chrome_prefs |
| 110 | 116 |
| 111 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 117 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
| OLD | NEW |