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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 class PrefStore; | 32 class PrefStore; |
33 class Profile; | 33 class Profile; |
34 class TrackedPreferenceValidationDelegate; | 34 class TrackedPreferenceValidationDelegate; |
35 | 35 |
36 namespace chrome_prefs { | 36 namespace chrome_prefs { |
37 | 37 |
38 namespace internals { | 38 namespace internals { |
39 | 39 |
40 extern const char kSettingsEnforcementTrialName[]; | 40 extern const char kSettingsEnforcementTrialName[]; |
41 extern const char kSettingsEnforcementGroupNoEnforcement[]; | 41 extern const char kSettingsEnforcementGroupNoEnforcement[]; |
42 extern const char kSettingsEnforcementGroupEnforceOnload[]; | |
43 extern const char kSettingsEnforcementGroupEnforceAlways[]; | 42 extern const char kSettingsEnforcementGroupEnforceAlways[]; |
44 extern const char kSettingsEnforcementGroupEnforceAlwaysWithExtensions[]; | 43 extern const char kSettingsEnforcementGroupEnforceAlwaysWithExtensions[]; |
45 extern const char kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE[]; | 44 extern const char kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE[]; |
46 | 45 |
47 } // namespace internals | 46 } // namespace internals |
48 | 47 |
49 // Factory methods that create and initialize a new instance of a | 48 // Factory methods that create and initialize a new instance of a |
50 // PrefService for Chrome with the applicable PrefStores. The | 49 // PrefService for Chrome with the applicable PrefStores. The |
51 // |pref_filename| points to the user preference file. This is the | 50 // |pref_filename| points to the user preference file. This is the |
52 // usual way to create a new PrefService. | 51 // usual way to create a new PrefService. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // chrome_prefs::Schedule*() methods and ignore presence of a domain when | 85 // chrome_prefs::Schedule*() methods and ignore presence of a domain when |
87 // determining the active SettingsEnforcement group. For testing only. | 86 // determining the active SettingsEnforcement group. For testing only. |
88 void DisableDelaysAndDomainCheckForTesting(); | 87 void DisableDelaysAndDomainCheckForTesting(); |
89 | 88 |
90 // Schedules an update check for all PrefHashStores, stores whose version | 89 // Schedules an update check for all PrefHashStores, stores whose version |
91 // doesn't match the latest version will then be updated. Clears all pref hash | 90 // doesn't match the latest version will then be updated. Clears all pref hash |
92 // state on platforms that don't yet support a pref hash store. | 91 // state on platforms that don't yet support a pref hash store. |
93 void SchedulePrefHashStoresUpdateCheck( | 92 void SchedulePrefHashStoresUpdateCheck( |
94 const base::FilePath& initial_profile_path); | 93 const base::FilePath& initial_profile_path); |
95 | 94 |
96 // Resets the contents of the preference hash store for the profile at | |
97 // |profile_path|. | |
98 void ResetPrefHashStore(const base::FilePath& profile_path); | |
99 | |
100 // Initializes the preferences for the profile at |profile_path| with the | 95 // Initializes the preferences for the profile at |profile_path| with the |
101 // preference values in |master_prefs|. Returns true on success. | 96 // preference values in |master_prefs|. Returns true on success. |
102 bool InitializePrefsFromMasterPrefs( | 97 bool InitializePrefsFromMasterPrefs( |
103 const base::FilePath& profile_path, | 98 const base::FilePath& profile_path, |
104 const base::DictionaryValue& master_prefs); | 99 const base::DictionaryValue& master_prefs); |
105 | 100 |
106 // Retrieves the time of the last preference reset event, if any, for the | 101 // Retrieves the time of the last preference reset event, if any, for the |
107 // provided profile. If no reset has occurred, returns a null |Time|. | 102 // provided profile. If no reset has occurred, returns a null |Time|. |
108 base::Time GetResetTime(Profile* profile); | 103 base::Time GetResetTime(Profile* profile); |
109 | 104 |
110 // Clears the time of the last preference reset event, if any, for the provided | 105 // Clears the time of the last preference reset event, if any, for the provided |
111 // profile. | 106 // profile. |
112 void ClearResetTime(Profile* profile); | 107 void ClearResetTime(Profile* profile); |
113 | 108 |
114 // Register local state prefs used by chrome preference system. | 109 // Register local state prefs used by chrome preference system. |
115 void RegisterPrefs(PrefRegistrySimple* registry); | 110 void RegisterPrefs(PrefRegistrySimple* registry); |
116 | 111 |
117 // Register user prefs used by chrome preference system. | 112 // Register user prefs used by chrome preference system. |
118 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 113 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
119 | 114 |
120 } // namespace chrome_prefs | 115 } // namespace chrome_prefs |
121 | 116 |
122 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ | 117 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_FACTORY_H_ |
OLD | NEW |