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

Side by Side Diff: components/user_prefs/tracked/registry_hash_store_contents_win.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: Apply comments from patch set 27 Created 4 years, 2 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 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 |store_key|. 16 // defined by |registry_path| and |store_key|.
17 explicit RegistryHashStoreContentsWin(const base::string16& registry_path, 17 explicit RegistryHashStoreContentsWin(const base::string16& registry_path,
18 const base::string16& store_key); 18 const base::string16& store_key);
19 19
20 // HashStoreContents overrides: 20 // HashStoreContents overrides:
21 bool IsCopyable() const override;
22 std::unique_ptr<HashStoreContents> MakeCopy() const override;
21 base::StringPiece GetUMASuffix() const override; 23 base::StringPiece GetUMASuffix() const override;
22 void Reset() override; 24 void Reset() override;
23 bool GetMac(const std::string& path, std::string* out_value) override; 25 bool GetMac(const std::string& path, std::string* out_value) override;
24 bool GetSplitMacs(const std::string& path, 26 bool GetSplitMacs(const std::string& path,
25 std::map<std::string, std::string>* split_macs) override; 27 std::map<std::string, std::string>* split_macs) override;
26 void SetMac(const std::string& path, const std::string& value) override; 28 void SetMac(const std::string& path, const std::string& value) override;
27 void SetSplitMac(const std::string& path, 29 void SetSplitMac(const std::string& path,
28 const std::string& split_path, 30 const std::string& split_path,
29 const std::string& value) override; 31 const std::string& value) override;
30 bool RemoveEntry(const std::string& path) override; 32 bool RemoveEntry(const std::string& path) override;
31 33
32 // Unsupported HashStoreContents overrides: 34 // Unsupported HashStoreContents overrides:
33 void ImportEntry(const std::string& path, 35 void ImportEntry(const std::string& path,
34 const base::Value* in_value) override; 36 const base::Value* in_value) override;
35 const base::DictionaryValue* GetContents() const override; 37 const base::DictionaryValue* GetContents() const override;
36 std::string GetSuperMac() const override; 38 std::string GetSuperMac() const override;
37 void SetSuperMac(const std::string& super_mac) override; 39 void SetSuperMac(const std::string& super_mac) override;
38 40
39 private: 41 private:
42 // Helper constructor for |MakeCopy|.
43 explicit RegistryHashStoreContentsWin(
44 const RegistryHashStoreContentsWin& other);
45
40 const base::string16 preference_key_name_; 46 const base::string16 preference_key_name_;
41
42 DISALLOW_COPY_AND_ASSIGN(RegistryHashStoreContentsWin);
43 }; 47 };
44 48
45 #endif // COMPONENTS_USER_PREFS_TRACKED_PREF_REGISTRY_HASH_STORE_CONTENTS_H_ 49 #endif // COMPONENTS_USER_PREFS_TRACKED_PREF_REGISTRY_HASH_STORE_CONTENTS_H_
OLDNEW
« no previous file with comments | « components/user_prefs/tracked/pref_hash_store.h ('k') | components/user_prefs/tracked/registry_hash_store_contents_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698