#include "chrome/browser/prefs/pref_hash_filter.h"
class PersistentPrefStore;
-class PrefHashStoreImpl;
+class PrefHashStore;
class PrefService;
+class TrackedPreferenceValidationDelegate;
namespace base {
class DictionaryValue;
// was built by ProfilePrefStoreManager.
static void ClearResetTime(PrefService* pref_service);
- // Deletes stored hashes for the managed profile.
- void ResetPrefHashStore();
-
// Creates a PersistentPrefStore providing access to the user preferences of
- // the managed profile.
+ // the managed profile. If |on_reset| is provided, it will be invoked if a
+ // reset occurs as a result of loading the profile's prefs.
+ // An optional |validation_delegate| will be notified
+ // of the status of each tracked preference as they are checked.
PersistentPrefStore* CreateProfilePrefStore(
- const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
-
- // Checks the presence/version of the hash store for the managed profile and
- // creates or updates it if necessary. Completes asynchronously and is safe if
- // the preferences/hash store are concurrently loaded/manipulated by another
- // task.
- void UpdateProfileHashStoreIfRequired(
- const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner,
+ const base::Closure& on_reset_on_load,
+ TrackedPreferenceValidationDelegate* validation_delegate);
// Initializes the preferences for the managed profile with the preference
// values in |master_prefs|. Acts synchronously, including blocking IO.
const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
private:
- // Returns a PrefHashStoreImpl for the managed profile. Should only be called
- // if |kPlatformSupportsPreferenceTracking|.
- scoped_ptr<PrefHashStoreImpl> GetPrefHashStoreImpl();
+ // Returns a PrefHashStore for the managed profile. Should only be called
+ // if |kPlatformSupportsPreferenceTracking|. |use_super_mac| determines
+ // whether the returned object will calculate, store, and validate super MACs
+ // (and, by extension, accept non-null newly protected preferences as
+ // TrustedInitialized).
+ scoped_ptr<PrefHashStore> GetPrefHashStore(bool use_super_mac);
const base::FilePath profile_path_;
const std::vector<PrefHashFilter::TrackedPreferenceMetadata>