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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
6 #define CHROME_BROWSER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "chrome/browser/prefs/tracked/hash_store_contents.h"
13 class DictionaryValue
;
16 namespace user_prefs
{
17 class PrefRegistrySyncable
;
18 } // namespace user_prefs
20 // Implements HashStoreContents by storing MACs in a DictionaryValue. The
21 // DictionaryValue is presumed to be the contents of a PrefStore.
22 // RegisterProfilePrefs() may be used to register all of the preferences used by
24 class DictionaryHashStoreContents
: public HashStoreContents
{
26 // Constructs a DictionaryHashStoreContents that reads from and writes to
28 explicit DictionaryHashStoreContents(base::DictionaryValue
* storage
);
30 // Registers required preferences.
31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable
* registry
);
33 // HashStoreContents implementation
34 virtual std::string
hash_store_id() const OVERRIDE
;
35 virtual void Reset() OVERRIDE
;
36 virtual bool IsInitialized() const OVERRIDE
;
37 virtual const base::DictionaryValue
* GetContents() const OVERRIDE
;
38 virtual scoped_ptr
<MutableDictionary
> GetMutableContents() OVERRIDE
;
39 virtual std::string
GetSuperMac() const OVERRIDE
;
40 virtual void SetSuperMac(const std::string
& super_mac
) OVERRIDE
;
43 base::DictionaryValue
* storage_
;
45 DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents
);
48 #endif // CHROME_BROWSER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_