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

Side by Side Diff: components/user_prefs/tracked/dictionary_hash_store_contents.h

Issue 2204943002: Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit and browser tests. GetType => GetUMASuffix Created 4 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
6 #define COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ 6 #define COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/user_prefs/tracked/hash_store_contents.h" 9 #include "components/user_prefs/tracked/hash_store_contents.h"
10 10
(...skipping 13 matching lines...) Expand all
24 class DictionaryHashStoreContents : public HashStoreContents { 24 class DictionaryHashStoreContents : public HashStoreContents {
25 public: 25 public:
26 // Constructs a DictionaryHashStoreContents that reads from and writes to 26 // Constructs a DictionaryHashStoreContents that reads from and writes to
27 // |storage|. 27 // |storage|.
28 explicit DictionaryHashStoreContents(base::DictionaryValue* storage); 28 explicit DictionaryHashStoreContents(base::DictionaryValue* storage);
29 29
30 // Registers required preferences. 30 // Registers required preferences.
31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
32 32
33 // HashStoreContents implementation 33 // HashStoreContents implementation
34 std::unique_ptr<HashStoreContents> MakeCopy() const override;
35 std::string GetUMASuffix() const override;
34 void Reset() override; 36 void Reset() override;
35 bool GetMac(const std::string& path, std::string* out_value) override; 37 bool GetMac(const std::string& path, std::string* out_value) override;
36 bool GetSplitMacs(const std::string& path, 38 bool GetSplitMacs(const std::string& path,
37 std::map<std::string, std::string>* split_macs) override; 39 std::map<std::string, std::string>* split_macs) override;
38 void SetMac(const std::string& path, const std::string& value) override; 40 void SetMac(const std::string& path, const std::string& value) override;
39 void SetSplitMac(const std::string& path, 41 void SetSplitMac(const std::string& path,
40 const std::string& split_path, 42 const std::string& split_path,
41 const std::string& value) override; 43 const std::string& value) override;
42 void ImportEntry(const std::string& path, 44 void ImportEntry(const std::string& path,
43 const base::Value* in_value) override; 45 const base::Value* in_value) override;
44 bool RemoveEntry(const std::string& path) override; 46 bool RemoveEntry(const std::string& path) override;
45 const base::DictionaryValue* GetContents() const override; 47 const base::DictionaryValue* GetContents() const override;
46 std::string GetSuperMac() const override; 48 std::string GetSuperMac() const override;
47 void SetSuperMac(const std::string& super_mac) override; 49 void SetSuperMac(const std::string& super_mac) override;
48 50
49 private: 51 private:
50 base::DictionaryValue* storage_; 52 base::DictionaryValue* storage_;
51 53
52 // Helper function to get a mutable version of the macs from |storage_|, 54 // Helper function to get a mutable version of the macs from |storage_|,
53 // creating it if needed and |create_if_null| is true. 55 // creating it if needed and |create_if_null| is true.
54 base::DictionaryValue* GetMutableContents(bool create_if_null); 56 base::DictionaryValue* GetMutableContents(bool create_if_null);
55 57
56 DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents); 58 DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents);
57 }; 59 };
58 60
59 #endif // COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ 61 #endif // COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698