Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: chrome/browser/prefs/tracked_split_preference.h

Issue 114223002: Multi-strategy based tracking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use base::ScopedPtrHashMap Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698