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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // Deletes stored hashes for the managed profile. | 81 // Deletes stored hashes for the managed profile. |
82 void ResetPrefHashStore(); | 82 void ResetPrefHashStore(); |
83 | 83 |
84 // Creates a PersistentPrefStore providing access to the user preferences of | 84 // Creates a PersistentPrefStore providing access to the user preferences of |
85 // the managed profile. An optional |validation_delegate| will be notified | 85 // the managed profile. An optional |validation_delegate| will be notified |
86 // of the status of each tracked preference as they are checked. | 86 // of the status of each tracked preference as they are checked. |
87 PersistentPrefStore* CreateProfilePrefStore( | 87 PersistentPrefStore* CreateProfilePrefStore( |
88 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, | 88 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, |
89 TrackedPreferenceValidationDelegate* validation_delegate); | 89 TrackedPreferenceValidationDelegate* validation_delegate); |
90 | 90 |
91 // Checks the presence/version of the hash store for the managed profile and | |
92 // creates or updates it if necessary. Completes asynchronously and is safe if | |
93 // the preferences/hash store are concurrently loaded/manipulated by another | |
94 // task. | |
95 void UpdateProfileHashStoreIfRequired( | |
96 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); | |
97 | |
98 // Initializes the preferences for the managed profile with the preference | 91 // Initializes the preferences for the managed profile with the preference |
99 // values in |master_prefs|. Acts synchronously, including blocking IO. | 92 // values in |master_prefs|. Acts synchronously, including blocking IO. |
100 // Returns true on success. | 93 // Returns true on success. |
101 bool InitializePrefsFromMasterPrefs( | 94 bool InitializePrefsFromMasterPrefs( |
102 const base::DictionaryValue& master_prefs); | 95 const base::DictionaryValue& master_prefs); |
103 | 96 |
104 // 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 |
105 // for testing migration. | 98 // for testing migration. |
106 PersistentPrefStore* CreateDeprecatedCombinedProfilePrefStore( | 99 PersistentPrefStore* CreateDeprecatedCombinedProfilePrefStore( |
107 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); | 100 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); |
108 | 101 |
109 private: | 102 private: |
110 // Returns a PrefHashStoreImpl for the managed profile. Should only be called | 103 // Returns a PrefHashStoreImpl for the managed profile. Should only be called |
111 // if |kPlatformSupportsPreferenceTracking|. | 104 // if |kPlatformSupportsPreferenceTracking|. |
112 scoped_ptr<PrefHashStoreImpl> GetPrefHashStoreImpl(); | 105 scoped_ptr<PrefHashStoreImpl> GetPrefHashStoreImpl(); |
113 | 106 |
| 107 scoped_ptr<PrefHashStoreImpl> GetLegacyPrefHashStoreImpl(); |
| 108 |
114 const base::FilePath profile_path_; | 109 const base::FilePath profile_path_; |
115 const std::vector<PrefHashFilter::TrackedPreferenceMetadata> | 110 const std::vector<PrefHashFilter::TrackedPreferenceMetadata> |
116 tracking_configuration_; | 111 tracking_configuration_; |
117 const size_t reporting_ids_count_; | 112 const size_t reporting_ids_count_; |
118 const std::string seed_; | 113 const std::string seed_; |
119 const std::string device_id_; | 114 const std::string device_id_; |
120 PrefService* local_state_; | 115 PrefService* local_state_; |
121 | 116 |
122 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); | 117 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); |
123 }; | 118 }; |
124 | 119 |
125 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 120 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
OLD | NEW |