Chromium Code Reviews| Index: chrome/browser/prefs/tracked/dictionary_hash_store_contents.h |
| diff --git a/chrome/browser/prefs/tracked/dictionary_hash_store_contents.h b/chrome/browser/prefs/tracked/dictionary_hash_store_contents.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c33cd6354b9570b35aaaa8fe2829a8db57d4263f |
| --- /dev/null |
| +++ b/chrome/browser/prefs/tracked/dictionary_hash_store_contents.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ |
| +#define CHROME_BROWSER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/macros.h" |
| +#include "chrome/browser/prefs/tracked/hash_store_contents.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} // namespace base |
| + |
| +namespace user_prefs { |
| +class PrefRegistrySyncable; |
| +} // namespace user_prefs |
| + |
| +// Implements HashStoreContents by storing MACs in a DictionaryValue. The |
| +// DictionaryValue is presumed to be the contents of a PrefStore. |
| +// RegisterProfilePrefs() may be used to register all of the preferences used by |
| +// this object. |
| +class DictionaryHashStoreContents : public HashStoreContents { |
| + public: |
| + // Constructs a DictionaryHashStoreContents that reads and writes to |
|
gab
2014/06/17 02:00:06
s/reads and writes to/reads from and writes to/
erikwright (departed)
2014/06/17 19:07:24
Done.
|
| + // |storage|. |
| + explicit DictionaryHashStoreContents(base::DictionaryValue* storage); |
|
gab
2014/06/17 02:00:06
The fact that |storage| must outlive this Dictiona
erikwright (departed)
2014/06/17 19:07:24
I believe it is implicit in the world of scoped_pt
|
| + |
| + // Registers required preferences. |
| + static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| + |
| + // HashStoreContents implementation |
| + virtual std::string hash_store_id() const OVERRIDE; |
| + virtual void Reset() OVERRIDE; |
| + virtual bool IsInitialized() const OVERRIDE; |
| + virtual const base::DictionaryValue* GetContents() const OVERRIDE; |
| + virtual scoped_ptr<MutableDictionary> GetMutableContents() OVERRIDE; |
| + virtual std::string GetSuperMac() const OVERRIDE; |
| + virtual void SetSuperMac(const std::string& super_mac) OVERRIDE; |
| + |
| + private: |
| + base::DictionaryValue* storage_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ |