| 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" |
| 11 #include "components/pref_registry/pref_registry_syncable.h" | 11 #include "components/pref_registry/pref_registry_syncable.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 const char kPreferenceMACs[] = "protection.macs"; | 15 const char kPreferenceMACs[] = "protection.macs"; |
| 16 const char kSuperMACPref[] = "protection.super_mac"; | 16 const char kSuperMACPref[] = "protection.super_mac"; |
| 17 | 17 |
| 18 class MutablePreferenceMacDictionary | 18 class MutablePreferenceMacDictionary |
| 19 : public HashStoreContents::MutableDictionary { | 19 : public HashStoreContents::MutableDictionary { |
| 20 public: | 20 public: |
| 21 explicit MutablePreferenceMacDictionary(base::DictionaryValue* storage); | 21 explicit MutablePreferenceMacDictionary(base::DictionaryValue* storage); |
| 22 | 22 |
| 23 // MutableDictionary implementation | 23 // MutableDictionary implementation |
| 24 virtual base::DictionaryValue* operator->() OVERRIDE; | 24 virtual base::DictionaryValue* operator->() override; |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 base::DictionaryValue* storage_; | 27 base::DictionaryValue* storage_; |
| 28 | 28 |
| 29 DISALLOW_COPY_AND_ASSIGN(MutablePreferenceMacDictionary); | 29 DISALLOW_COPY_AND_ASSIGN(MutablePreferenceMacDictionary); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 MutablePreferenceMacDictionary::MutablePreferenceMacDictionary( | 32 MutablePreferenceMacDictionary::MutablePreferenceMacDictionary( |
| 33 base::DictionaryValue* storage) | 33 base::DictionaryValue* storage) |
| 34 : storage_(storage) { | 34 : storage_(storage) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 std::string DictionaryHashStoreContents::GetSuperMac() const { | 91 std::string DictionaryHashStoreContents::GetSuperMac() const { |
| 92 std::string super_mac_string; | 92 std::string super_mac_string; |
| 93 storage_->GetString(kSuperMACPref, &super_mac_string); | 93 storage_->GetString(kSuperMACPref, &super_mac_string); |
| 94 return super_mac_string; | 94 return super_mac_string; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) { | 97 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) { |
| 98 storage_->SetString(kSuperMACPref, super_mac); | 98 storage_->SetString(kSuperMACPref, super_mac); |
| 99 } | 99 } |
| OLD | NEW |