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_SPLIT_PREFERENCE_H_ |
| 6 #define CHROME_BROWSER_PREFS_TRACKED_SPLIT_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 TrackedSplitPreference must be tracking a dictionary pref. Each top-level |
| 14 // entry in its dictionary is tracked and enforced independently. |
| 15 // Note: preferences using this strategy must be kept in sync with |
| 16 // TrackedSplitPreferences in histograms.xml. |
| 17 class TrackedSplitPreference : public TrackedPreference { |
| 18 public: |
| 19 // Constructs a TrackedSplitPreference. |pref_path| must be a dictionary pref. |
| 20 TrackedSplitPreference( |
| 21 const std::string& pref_path, |
| 22 size_t reporting_id, |
| 23 size_t reporting_ids_count, |
| 24 TrackedPreferenceHelper::EnforcementLevel enforcement_level); |
| 25 |
| 26 // TrackedPreference implementation. |
| 27 virtual void StoreHash(const base::Value* value, |
| 28 PrefHashStore* pref_hash_store) const OVERRIDE; |
| 29 virtual void EnforceAndReport( |
| 30 PrefHashStore* pref_hash_store, |
| 31 base::DictionaryValue* pref_store_contents) const OVERRIDE; |
| 32 |
| 33 private: |
| 34 const std::string pref_path_; |
| 35 const TrackedPreferenceHelper helper_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(TrackedSplitPreference); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_PREFS_TRACKED_SPLIT_PREFERENCE_H_ |
OLD | NEW |