OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/prefs/tracked/dictionary_hash_store_contents.h" | 5 #include "chrome/browser/prefs/tracked/dictionary_hash_store_contents.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/persistent_pref_store.h" | 9 #include "base/prefs/persistent_pref_store.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 DictionaryHashStoreContents::DictionaryHashStoreContents( | 50 DictionaryHashStoreContents::DictionaryHashStoreContents( |
51 base::DictionaryValue* storage) | 51 base::DictionaryValue* storage) |
52 : storage_(storage) { | 52 : storage_(storage) { |
53 } | 53 } |
54 | 54 |
55 // static | 55 // static |
56 void DictionaryHashStoreContents::RegisterProfilePrefs( | 56 void DictionaryHashStoreContents::RegisterProfilePrefs( |
57 user_prefs::PrefRegistrySyncable* registry) { | 57 user_prefs::PrefRegistrySyncable* registry) { |
58 registry->RegisterDictionaryPref( | 58 registry->RegisterDictionaryPref(kPreferenceMACs); |
59 kPreferenceMACs, | 59 registry->RegisterStringPref(kSuperMACPref, std::string()); |
60 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
61 registry->RegisterStringPref( | |
62 kSuperMACPref, | |
63 std::string(), | |
64 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
65 } | 60 } |
66 | 61 |
67 std::string DictionaryHashStoreContents::hash_store_id() const { | 62 std::string DictionaryHashStoreContents::hash_store_id() const { |
68 return ""; | 63 return ""; |
69 } | 64 } |
70 | 65 |
71 void DictionaryHashStoreContents::Reset() { | 66 void DictionaryHashStoreContents::Reset() { |
72 storage_->Remove(kPreferenceMACs, NULL); | 67 storage_->Remove(kPreferenceMACs, NULL); |
73 } | 68 } |
74 | 69 |
(...skipping 15 matching lines...) Expand all Loading... |
90 | 85 |
91 std::string DictionaryHashStoreContents::GetSuperMac() const { | 86 std::string DictionaryHashStoreContents::GetSuperMac() const { |
92 std::string super_mac_string; | 87 std::string super_mac_string; |
93 storage_->GetString(kSuperMACPref, &super_mac_string); | 88 storage_->GetString(kSuperMACPref, &super_mac_string); |
94 return super_mac_string; | 89 return super_mac_string; |
95 } | 90 } |
96 | 91 |
97 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) { | 92 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) { |
98 storage_->SetString(kSuperMACPref, super_mac); | 93 storage_->SetString(kSuperMACPref, super_mac); |
99 } | 94 } |
OLD | NEW |