| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "components/user_prefs/tracked/pref_hash_filter.h" | 17 #include "services/preferences/public/interfaces/preferences_configuration.mojom
.h" |
| 18 | 18 |
| 19 class HashStoreContents; | 19 class HashStoreContents; |
| 20 class PersistentPrefStore; | 20 class PersistentPrefStore; |
| 21 class PrefHashStore; | 21 class PrefHashStore; |
| 22 class PrefRegistry; | 22 class PrefRegistry; |
| 23 class PrefService; | 23 class PrefService; |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class DictionaryValue; | 26 class DictionaryValue; |
| 27 class SequencedTaskRunner; | 27 class SequencedTaskRunner; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 48 // Instantiates a ProfilePrefStoreManager with the configuration required to | 48 // Instantiates a ProfilePrefStoreManager with the configuration required to |
| 49 // manage the user preferences of the profile at |profile_path|. | 49 // manage the user preferences of the profile at |profile_path|. |
| 50 // |tracking_configuration| is used for preference tracking. | 50 // |tracking_configuration| is used for preference tracking. |
| 51 // |reporting_ids_count| is the count of all possible tracked preference IDs | 51 // |reporting_ids_count| is the count of all possible tracked preference IDs |
| 52 // (possibly greater than |tracking_configuration.size()|). | 52 // (possibly greater than |tracking_configuration.size()|). |
| 53 // |seed| and |legacy_device_id| are used to track preference value changes | 53 // |seed| and |legacy_device_id| are used to track preference value changes |
| 54 // and must be the same on each launch in order to verify loaded preference | 54 // and must be the same on each launch in order to verify loaded preference |
| 55 // values. | 55 // values. |
| 56 ProfilePrefStoreManager( | 56 ProfilePrefStoreManager( |
| 57 const base::FilePath& profile_path, | 57 const base::FilePath& profile_path, |
| 58 const std::vector<PrefHashFilter::TrackedPreferenceMetadata>& | 58 std::vector<prefs::mojom::TrackedPreferenceMetadataPtr> |
| 59 tracking_configuration, | 59 tracking_configuration, |
| 60 size_t reporting_ids_count, | 60 size_t reporting_ids_count, |
| 61 const std::string& seed, | 61 const std::string& seed, |
| 62 const std::string& legacy_device_id, | 62 const std::string& legacy_device_id, |
| 63 PrefService* local_state); | 63 PrefService* local_state); |
| 64 | 64 |
| 65 ~ProfilePrefStoreManager(); | 65 ~ProfilePrefStoreManager(); |
| 66 | 66 |
| 67 static const bool kPlatformSupportsPreferenceTracking; | 67 static const bool kPlatformSupportsPreferenceTracking; |
| 68 | 68 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // extra out-of-band verifications, or nullptrs if not available on this | 123 // extra out-of-band verifications, or nullptrs if not available on this |
| 124 // platform. | 124 // platform. |
| 125 std::pair<std::unique_ptr<PrefHashStore>, std::unique_ptr<HashStoreContents>> | 125 std::pair<std::unique_ptr<PrefHashStore>, std::unique_ptr<HashStoreContents>> |
| 126 GetExternalVerificationPrefHashStorePair(); | 126 GetExternalVerificationPrefHashStorePair(); |
| 127 | 127 |
| 128 // Connects to the pref service over mojo and configures it. | 128 // Connects to the pref service over mojo and configures it. |
| 129 void ConfigurePrefService(const base::Closure& on_reset_on_load, | 129 void ConfigurePrefService(const base::Closure& on_reset_on_load, |
| 130 service_manager::Connector* connector); | 130 service_manager::Connector* connector); |
| 131 | 131 |
| 132 const base::FilePath profile_path_; | 132 const base::FilePath profile_path_; |
| 133 const std::vector<PrefHashFilter::TrackedPreferenceMetadata> | 133 std::vector<prefs::mojom::TrackedPreferenceMetadataPtr> |
| 134 tracking_configuration_; | 134 tracking_configuration_; |
| 135 const size_t reporting_ids_count_; | 135 const size_t reporting_ids_count_; |
| 136 const std::string seed_; | 136 const std::string seed_; |
| 137 const std::string legacy_device_id_; | 137 const std::string legacy_device_id_; |
| 138 PrefService* local_state_; | 138 PrefService* local_state_; |
| 139 | 139 |
| 140 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); | 140 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 143 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
| OLD | NEW |