| 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> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Provides a facade through which the user preference store may be accessed and | 34 // Provides a facade through which the user preference store may be accessed and |
| 35 // managed. | 35 // managed. |
| 36 class ProfilePrefStoreManager { | 36 class ProfilePrefStoreManager { |
| 37 public: | 37 public: |
| 38 // Instantiates a ProfilePrefStoreManager with the configuration required to | 38 // Instantiates a ProfilePrefStoreManager with the configuration required to |
| 39 // manage the user preferences of the profile at |profile_path|. | 39 // manage the user preferences of the profile at |profile_path|. |
| 40 // |tracking_configuration| is used for preference tracking. | 40 // |tracking_configuration| is used for preference tracking. |
| 41 // |reporting_ids_count| is the count of all possible tracked preference IDs | 41 // |reporting_ids_count| is the count of all possible tracked preference IDs |
| 42 // (possibly greater than |tracking_configuration.size()|). | 42 // (possibly greater than |tracking_configuration.size()|). |
| 43 // |seed| and |device_id| are used to track preference value changes and must | 43 // |seed| and |legacy_device_id| are used to track preference value changes |
| 44 // be the same on each launch in order to verify loaded preference values. | 44 // and must be the same on each launch in order to verify loaded preference |
| 45 // values. |
| 45 ProfilePrefStoreManager( | 46 ProfilePrefStoreManager( |
| 46 const base::FilePath& profile_path, | 47 const base::FilePath& profile_path, |
| 47 const std::vector<PrefHashFilter::TrackedPreferenceMetadata>& | 48 const std::vector<PrefHashFilter::TrackedPreferenceMetadata>& |
| 48 tracking_configuration, | 49 tracking_configuration, |
| 49 size_t reporting_ids_count, | 50 size_t reporting_ids_count, |
| 50 const std::string& seed, | 51 const std::string& seed, |
| 51 const std::string& device_id, | 52 const std::string& legacy_device_id, |
| 52 PrefService* local_state); | 53 PrefService* local_state); |
| 53 | 54 |
| 54 ~ProfilePrefStoreManager(); | 55 ~ProfilePrefStoreManager(); |
| 55 | 56 |
| 56 static const bool kPlatformSupportsPreferenceTracking; | 57 static const bool kPlatformSupportsPreferenceTracking; |
| 57 | 58 |
| 58 // Register user prefs used by the profile preferences system. | 59 // Register user prefs used by the profile preferences system. |
| 59 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 60 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 60 | 61 |
| 61 // Retrieves the time of the last preference reset event, if any, for | 62 // Retrieves the time of the last preference reset event, if any, for |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // extra out-of-band verifications, or nullptrs if not available on this | 111 // extra out-of-band verifications, or nullptrs if not available on this |
| 111 // platform. | 112 // platform. |
| 112 std::pair<std::unique_ptr<PrefHashStore>, std::unique_ptr<HashStoreContents>> | 113 std::pair<std::unique_ptr<PrefHashStore>, std::unique_ptr<HashStoreContents>> |
| 113 GetExternalVerificationPrefHashStorePair(); | 114 GetExternalVerificationPrefHashStorePair(); |
| 114 | 115 |
| 115 const base::FilePath profile_path_; | 116 const base::FilePath profile_path_; |
| 116 const std::vector<PrefHashFilter::TrackedPreferenceMetadata> | 117 const std::vector<PrefHashFilter::TrackedPreferenceMetadata> |
| 117 tracking_configuration_; | 118 tracking_configuration_; |
| 118 const size_t reporting_ids_count_; | 119 const size_t reporting_ids_count_; |
| 119 const std::string seed_; | 120 const std::string seed_; |
| 120 const std::string device_id_; | 121 const std::string legacy_device_id_; |
| 121 PrefService* local_state_; | 122 PrefService* local_state_; |
| 122 | 123 |
| 123 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); | 124 DISALLOW_COPY_AND_ASSIGN(ProfilePrefStoreManager); |
| 124 }; | 125 }; |
| 125 | 126 |
| 126 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ | 127 #endif // CHROME_BROWSER_PREFS_PROFILE_PREF_STORE_MANAGER_H_ |
| OLD | NEW |