OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROFILE_PREF_STORE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
6 #define CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 6 #define CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // was built by ProfilePrefStoreManager. | 72 // was built by ProfilePrefStoreManager. |
73 // If no reset has occurred, returns a null |Time|. | 73 // If no reset has occurred, returns a null |Time|. |
74 static base::Time GetResetTime(PrefService* pref_service); | 74 static base::Time GetResetTime(PrefService* pref_service); |
75 | 75 |
76 // Clears the time of the last preference reset event, if any, for | 76 // Clears the time of the last preference reset event, if any, for |
77 // |pref_service|. Assumes that |pref_service| is backed by a PrefStore that | 77 // |pref_service|. Assumes that |pref_service| is backed by a PrefStore that |
78 // was built by ProfilePrefStoreManager. | 78 // was built by ProfilePrefStoreManager. |
79 static void ClearResetTime(PrefService* pref_service); | 79 static void ClearResetTime(PrefService* pref_service); |
80 | 80 |
81 // Creates a PersistentPrefStore providing access to the user preferences of | 81 // Creates a PersistentPrefStore providing access to the user preferences of |
82 // the managed profile. An optional |validation_delegate| will be notified | 82 // the managed profile. If |on_reset| is provided, it will be invoked if a |
| 83 // reset occurs as a result of loading the profile's prefs. |
| 84 // An optional |validation_delegate| will be notified |
83 // of the status of each tracked preference as they are checked. | 85 // of the status of each tracked preference as they are checked. |
84 PersistentPrefStore* CreateProfilePrefStore( | 86 PersistentPrefStore* CreateProfilePrefStore( |
85 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, | 87 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, |
| 88 const base::Closure& on_reset_on_load, |
86 TrackedPreferenceValidationDelegate* validation_delegate); | 89 TrackedPreferenceValidationDelegate* validation_delegate); |
87 | 90 |
88 // Initializes the preferences for the managed profile with the preference | 91 // Initializes the preferences for the managed profile with the preference |
89 // values in |master_prefs|. Acts synchronously, including blocking IO. | 92 // values in |master_prefs|. Acts synchronously, including blocking IO. |
90 // Returns true on success. | 93 // Returns true on success. |
91 bool InitializePrefsFromMasterPrefs( | 94 bool InitializePrefsFromMasterPrefs( |
92 const base::DictionaryValue& master_prefs); | 95 const base::DictionaryValue& master_prefs); |
93 | 96 |
94 // Creates a single-file PrefStore as was used in M34 and earlier. Used only | 97 // Creates a single-file PrefStore as was used in M34 and earlier. Used only |
95 // for testing migration. | 98 // for testing migration. |
(...skipping 13 matching lines...) Expand all Loading... |
109 tracking_configuration_; | 112 tracking_configuration_; |
110 const size_t reporting_ids_count_; | 113 const size_t reporting_ids_count_; |
111 const std::string seed_; | 114 const std::string seed_; |
112 const std::string device_id_; | 115 const std::string device_id_; |
113 PrefService* local_state_; | 116 PrefService* local_state_; |
114 | 117 |
115 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); | 118 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); |
116 }; | 119 }; |
117 | 120 |
118 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 121 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
OLD | NEW |