| 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 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/prefs/pref_hash_filter.h" | 15 #include "chrome/browser/prefs/pref_hash_filter.h" |
| 16 | 16 |
| 17 class PersistentPrefStore; | 17 class PersistentPrefStore; |
| 18 class PrefHashStoreImpl; | 18 class PrefHashStoreImpl; |
| 19 class PrefService; | 19 class PrefService; |
| 20 class TrackedPreferenceValidationDelegate; |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 class DictionaryValue; | 23 class DictionaryValue; |
| 23 class SequencedTaskRunner; | 24 class SequencedTaskRunner; |
| 24 } // namespace base | 25 } // namespace base |
| 25 | 26 |
| 26 namespace user_prefs { | 27 namespace user_prefs { |
| 27 class PrefRegistrySyncable; | 28 class PrefRegistrySyncable; |
| 28 } // namespace user_prefs | 29 } // namespace user_prefs |
| 29 | 30 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 75 |
| 75 // 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 |
| 76 // |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 |
| 77 // was built by ProfilePrefStoreManager. | 78 // was built by ProfilePrefStoreManager. |
| 78 static void ClearResetTime(PrefService* pref_service); | 79 static void ClearResetTime(PrefService* pref_service); |
| 79 | 80 |
| 80 // Deletes stored hashes for the managed profile. | 81 // Deletes stored hashes for the managed profile. |
| 81 void ResetPrefHashStore(); | 82 void ResetPrefHashStore(); |
| 82 | 83 |
| 83 // Creates a PersistentPrefStore providing access to the user preferences of | 84 // Creates a PersistentPrefStore providing access to the user preferences of |
| 84 // the managed profile. | 85 // the managed profile. An optional |validation_delegate| will be notified |
| 86 // of the status of each tracked preference as they are checked. |
| 85 PersistentPrefStore* CreateProfilePrefStore( | 87 PersistentPrefStore* CreateProfilePrefStore( |
| 86 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); | 88 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, |
| 89 TrackedPreferenceValidationDelegate* validation_delegate); |
| 87 | 90 |
| 88 // Checks the presence/version of the hash store for the managed profile and | 91 // Checks the presence/version of the hash store for the managed profile and |
| 89 // creates or updates it if necessary. Completes asynchronously and is safe if | 92 // creates or updates it if necessary. Completes asynchronously and is safe if |
| 90 // the preferences/hash store are concurrently loaded/manipulated by another | 93 // the preferences/hash store are concurrently loaded/manipulated by another |
| 91 // task. | 94 // task. |
| 92 void UpdateProfileHashStoreIfRequired( | 95 void UpdateProfileHashStoreIfRequired( |
| 93 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); | 96 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); |
| 94 | 97 |
| 95 // Initializes the preferences for the managed profile with the preference | 98 // Initializes the preferences for the managed profile with the preference |
| 96 // values in |master_prefs|. Acts synchronously, including blocking IO. | 99 // values in |master_prefs|. Acts synchronously, including blocking IO. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 113 tracking_configuration_; | 116 tracking_configuration_; |
| 114 const size_t reporting_ids_count_; | 117 const size_t reporting_ids_count_; |
| 115 const std::string seed_; | 118 const std::string seed_; |
| 116 const std::string device_id_; | 119 const std::string device_id_; |
| 117 PrefService* local_state_; | 120 PrefService* local_state_; |
| 118 | 121 |
| 119 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); | 122 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); |
| 120 }; | 123 }; |
| 121 | 124 |
| 122 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 125 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
| OLD | NEW |