OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PREFS_TRACKED_ATOMIC_PREFERENCE_H_ |
| 6 #define CHROME_BROWSER_PREFS_TRACKED_ATOMIC_PREFERENCE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/browser/prefs/tracked_preference.h" |
| 11 #include "chrome/browser/prefs/tracked_preference_helper.h" |
| 12 |
| 13 // A TrackedAtomicPreference is tracked as a whole. A hash is stored for its |
| 14 // entire value and it is entirely reset on mismatch. |
| 15 class TrackedAtomicPreference : public TrackedPreference { |
| 16 public: |
| 17 TrackedAtomicPreference( |
| 18 const std::string& pref_path, |
| 19 size_t reporting_id, |
| 20 size_t reporting_ids_count, |
| 21 TrackedPreferenceHelper::EnforcementLevel enforcement_level); |
| 22 |
| 23 // TrackedPreference implementation. |
| 24 virtual void StoreHash(const base::Value* value, |
| 25 PrefHashStore* pref_hash_store) const OVERRIDE; |
| 26 virtual void EnforceAndReport( |
| 27 PrefHashStore* pref_hash_store, |
| 28 base::DictionaryValue* pref_store_contents) const OVERRIDE; |
| 29 |
| 30 private: |
| 31 const std::string pref_path_; |
| 32 const TrackedPreferenceHelper helper_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(TrackedAtomicPreference); |
| 35 }; |
| 36 |
| 37 #endif // CHROME_BROWSER_PREFS_TRACKED_ATOMIC_PREFERENCE_H_ |
OLD | NEW |