| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PREF_METRICS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 void CheckTrackedPreferences(); | 101 void CheckTrackedPreferences(); |
| 102 | 102 |
| 103 // Updates the hash of the tracked preference in local state. This must be | 103 // Updates the hash of the tracked preference in local state. This must be |
| 104 // called after |device_id| has been set. | 104 // called after |device_id| has been set. |
| 105 void UpdateTrackedPreference(const char* path); | 105 void UpdateTrackedPreference(const char* path); |
| 106 | 106 |
| 107 // Removes the tracked preference from local state. Returns 'true' iff. the | 107 // Removes the tracked preference from local state. Returns 'true' iff. the |
| 108 // value was present. | 108 // value was present. |
| 109 bool RemoveTrackedPreference(const char* path); | 109 bool RemoveTrackedPreference(const char* path); |
| 110 | 110 |
| 111 // Gets the path to the preference value hash in local state. | |
| 112 std::string GetHashedPrefPath(const char* path); | |
| 113 | |
| 114 // Computes an MD5 hash for the given preference value. | 111 // Computes an MD5 hash for the given preference value. |
| 115 std::string GetHashedPrefValue(const char* path, const base::Value* value); | 112 std::string GetHashedPrefValue(const char* path, const base::Value* value); |
| 116 | 113 |
| 117 void InitializePrefObservers(); | 114 void InitializePrefObservers(); |
| 118 | 115 |
| 119 Profile* profile_; | 116 Profile* profile_; |
| 120 PrefService* prefs_; | 117 PrefService* prefs_; |
| 121 PrefService* local_state_; | 118 PrefService* local_state_; |
| 122 std::string profile_name_; | 119 std::string profile_name_; |
| 123 std::string pref_hash_seed_; | 120 std::string pref_hash_seed_; |
| 124 std::string device_id_; | 121 std::string device_id_; |
| 125 const char** tracked_pref_paths_; | 122 const char** tracked_pref_paths_; |
| 126 const int tracked_pref_path_count_; | 123 const int tracked_pref_path_count_; |
| 127 bool checked_tracked_prefs_; | 124 bool checked_tracked_prefs_; |
| 128 | 125 |
| 129 PrefChangeRegistrar pref_registrar_; | 126 PrefChangeRegistrar pref_registrar_; |
| 130 scoped_ptr<SyncedPrefChangeRegistrar> synced_pref_change_registrar_; | 127 scoped_ptr<SyncedPrefChangeRegistrar> synced_pref_change_registrar_; |
| 131 | 128 |
| 132 base::WeakPtrFactory<PrefMetricsService> weak_factory_; | 129 base::WeakPtrFactory<PrefMetricsService> weak_factory_; |
| 133 | 130 |
| 134 DISALLOW_COPY_AND_ASSIGN(PrefMetricsService); | 131 DISALLOW_COPY_AND_ASSIGN(PrefMetricsService); |
| 135 }; | 132 }; |
| 136 | 133 |
| 137 #endif // CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ | 134 #endif // CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_ |
| OLD | NEW |