OLD | NEW |
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 Loading... |
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 bool IsCopyable() const override; | |
35 std::unique_ptr<HashStoreContents> MakeCopy() const override; | |
36 base::StringPiece GetUMASuffix() const override; | 34 base::StringPiece GetUMASuffix() const override; |
37 void Reset() override; | 35 void Reset() override; |
38 bool GetMac(const std::string& path, std::string* out_value) override; | 36 bool GetMac(const std::string& path, std::string* out_value) override; |
39 bool GetSplitMacs(const std::string& path, | 37 bool GetSplitMacs(const std::string& path, |
40 std::map<std::string, std::string>* split_macs) override; | 38 std::map<std::string, std::string>* split_macs) override; |
41 void SetMac(const std::string& path, const std::string& value) override; | 39 void SetMac(const std::string& path, const std::string& value) override; |
42 void SetSplitMac(const std::string& path, | 40 void SetSplitMac(const std::string& path, |
43 const std::string& split_path, | 41 const std::string& split_path, |
44 const std::string& value) override; | 42 const std::string& value) override; |
45 void ImportEntry(const std::string& path, | 43 void ImportEntry(const std::string& path, |
46 const base::Value* in_value) override; | 44 const base::Value* in_value) override; |
47 bool RemoveEntry(const std::string& path) override; | 45 bool RemoveEntry(const std::string& path) override; |
48 const base::DictionaryValue* GetContents() const override; | 46 const base::DictionaryValue* GetContents() const override; |
49 std::string GetSuperMac() const override; | 47 std::string GetSuperMac() const override; |
50 void SetSuperMac(const std::string& super_mac) override; | 48 void SetSuperMac(const std::string& super_mac) override; |
51 | 49 |
52 private: | 50 private: |
53 base::DictionaryValue* storage_; | 51 base::DictionaryValue* storage_; |
54 | 52 |
55 // Helper function to get a mutable version of the macs from |storage_|, | 53 // Helper function to get a mutable version of the macs from |storage_|, |
56 // creating it if needed and |create_if_null| is true. | 54 // creating it if needed and |create_if_null| is true. |
57 base::DictionaryValue* GetMutableContents(bool create_if_null); | 55 base::DictionaryValue* GetMutableContents(bool create_if_null); |
58 | 56 |
59 DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents); | 57 DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents); |
60 }; | 58 }; |
61 | 59 |
62 #endif // COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ | 60 #endif // COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ |
OLD | NEW |