OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PREF_REGISTRY_HASH_STORE_CONTENTS_WIN_H_ | 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_PREF_REGISTRY_HASH_STORE_CONTENTS_WIN_H_ |
6 #define COMPONENTS_USER_PREFS_TRACKED_PREF_REGISTRY_HASH_STORE_CONTENTS_WIN_H_ | 6 #define COMPONENTS_USER_PREFS_TRACKED_PREF_REGISTRY_HASH_STORE_CONTENTS_WIN_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "components/user_prefs/tracked/hash_store_contents.h" | 10 #include "components/user_prefs/tracked/hash_store_contents.h" |
11 | 11 |
12 // Implements HashStoreContents by storing MACs in the Windows registry. | 12 // Implements HashStoreContents by storing MACs in the Windows registry. |
13 class RegistryHashStoreContentsWin : public HashStoreContents { | 13 class RegistryHashStoreContentsWin : public HashStoreContents { |
14 public: | 14 public: |
15 // Constructs a RegistryHashStoreContents which acts on a registry entry | 15 // Constructs a RegistryHashStoreContents which acts on a registry entry |
16 // defined by |registry_path| and |profile_name|. | 16 // defined by |registry_path| and |profile_name|. |
17 explicit RegistryHashStoreContentsWin(const base::string16& registry_path, | 17 explicit RegistryHashStoreContentsWin(const base::string16& registry_path, |
18 const base::string16& profile_name); | 18 const base::string16& profile_name); |
19 | 19 |
20 // HashStoreContents overrides: | 20 // HashStoreContents overrides: |
| 21 std::unique_ptr<HashStoreContents> MakeCopy() const override; |
| 22 std::string GetUMASuffix() const override; |
21 void Reset() override; | 23 void Reset() override; |
22 bool GetMac(const std::string& path, std::string* out_value) override; | 24 bool GetMac(const std::string& path, std::string* out_value) override; |
23 bool GetSplitMacs(const std::string& path, | 25 bool GetSplitMacs(const std::string& path, |
24 std::map<std::string, std::string>* split_macs) override; | 26 std::map<std::string, std::string>* split_macs) override; |
25 void SetMac(const std::string& path, const std::string& value) override; | 27 void SetMac(const std::string& path, const std::string& value) override; |
26 void SetSplitMac(const std::string& path, | 28 void SetSplitMac(const std::string& path, |
27 const std::string& split_path, | 29 const std::string& split_path, |
28 const std::string& value) override; | 30 const std::string& value) override; |
29 bool RemoveEntry(const std::string& path) override; | 31 bool RemoveEntry(const std::string& path) override; |
30 | 32 |
31 // Unsupported HashStoreContents overrides: | 33 // Unsupported HashStoreContents overrides: |
32 void ImportEntry(const std::string& path, | 34 void ImportEntry(const std::string& path, |
33 const base::Value* in_value) override; | 35 const base::Value* in_value) override; |
34 const base::DictionaryValue* GetContents() const override; | 36 const base::DictionaryValue* GetContents() const override; |
35 std::string GetSuperMac() const override; | 37 std::string GetSuperMac() const override; |
36 void SetSuperMac(const std::string& super_mac) override; | 38 void SetSuperMac(const std::string& super_mac) override; |
37 | 39 |
38 private: | 40 private: |
| 41 // Helper constructor for |MakeCopy|. |
| 42 explicit RegistryHashStoreContentsWin( |
| 43 const base::string16& preference_key_name); |
| 44 |
39 const base::string16 preference_key_name_; | 45 const base::string16 preference_key_name_; |
40 | 46 |
41 DISALLOW_COPY_AND_ASSIGN(RegistryHashStoreContentsWin); | 47 DISALLOW_COPY_AND_ASSIGN(RegistryHashStoreContentsWin); |
42 }; | 48 }; |
43 | 49 |
44 #endif // COMPONENTS_USER_PREFS_TRACKED_PREF_REGISTRY_HASH_STORE_CONTENTS_H_ | 50 #endif // COMPONENTS_USER_PREFS_TRACKED_PREF_REGISTRY_HASH_STORE_CONTENTS_H_ |
OLD | NEW |