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 #include "components/user_prefs/tracked/pref_service_hash_store_contents.h" | 5 #include "components/user_prefs/tracked/pref_service_hash_store_contents.h" |
6 | 6 |
7 #include "base/prefs/pref_registry_simple.h" | |
8 #include "base/prefs/pref_service.h" | |
9 #include "base/prefs/scoped_user_pref_update.h" | |
10 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "components/prefs/pref_registry_simple.h" |
| 9 #include "components/prefs/pref_service.h" |
| 10 #include "components/prefs/scoped_user_pref_update.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 // Implements get-or-create of a dictionary value and holds a | 14 // Implements get-or-create of a dictionary value and holds a |
15 // DictionaryPrefUpdate. | 15 // DictionaryPrefUpdate. |
16 class PrefServiceMutableDictionary | 16 class PrefServiceMutableDictionary |
17 : public HashStoreContents::MutableDictionary { | 17 : public HashStoreContents::MutableDictionary { |
18 public: | 18 public: |
19 // Creates an instance that provides mutable access to a dictionary value | 19 // Creates an instance that provides mutable access to a dictionary value |
20 // named |key| that is a child of |kProfilePreferenceHashes| in | 20 // named |key| that is a child of |kProfilePreferenceHashes| in |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 hash_of_hashes_dict->GetStringWithoutPathExpansion(hash_store_id_, | 137 hash_of_hashes_dict->GetStringWithoutPathExpansion(hash_store_id_, |
138 &hash_of_hashes); | 138 &hash_of_hashes); |
139 } | 139 } |
140 return hash_of_hashes; | 140 return hash_of_hashes; |
141 } | 141 } |
142 | 142 |
143 void PrefServiceHashStoreContents::SetSuperMac(const std::string& super_mac) { | 143 void PrefServiceHashStoreContents::SetSuperMac(const std::string& super_mac) { |
144 PrefServiceMutableDictionary(kHashOfHashesDict, pref_service_) | 144 PrefServiceMutableDictionary(kHashOfHashesDict, pref_service_) |
145 ->SetStringWithoutPathExpansion(hash_store_id_, super_mac); | 145 ->SetStringWithoutPathExpansion(hash_store_id_, super_mac); |
146 } | 146 } |
OLD | NEW |