Upstream version 9.37.195.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / prefs / profile_pref_store_manager.h
index 9463d0b..759b988 100644 (file)
@@ -15,8 +15,9 @@
 #include "chrome/browser/prefs/pref_hash_filter.h"
 
 class PersistentPrefStore;
-class PrefHashStoreImpl;
+class PrefHashStore;
 class PrefService;
+class TrackedPreferenceValidationDelegate;
 
 namespace base {
 class DictionaryValue;
@@ -77,20 +78,15 @@ class ProfilePrefStoreManager {
   // 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.
@@ -104,15 +100,12 @@ class ProfilePrefStoreManager {
       const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
 
  private:
-  class InitializeHashStoreObserver;
-
-  // Returns a PrefHashStoreImpl for the managed profile. Should only be called
-  // if |kPlatformSupportsPreferenceTracking|.
-  scoped_ptr<PrefHashStoreImpl> GetPrefHashStoreImpl();
-
-  // Returns a PrefHashStore that is a copy of the current state of the real
-  // hash store.
-  scoped_ptr<PrefHashStore> CopyPrefHashStore();
+  // 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>