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

Side by Side Diff: components/user_prefs/tracked/dictionary_hash_store_contents.cc

Issue 2111253002: Clean up old legacy preference migration logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove now unused kHashStoreId in unit test Created 4 years, 5 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 (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 "components/user_prefs/tracked/dictionary_hash_store_contents.h" 5 #include "components/user_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/macros.h" 9 #include "base/macros.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 : storage_(storage) { 53 : storage_(storage) {
54 } 54 }
55 55
56 // static 56 // static
57 void DictionaryHashStoreContents::RegisterProfilePrefs( 57 void DictionaryHashStoreContents::RegisterProfilePrefs(
58 user_prefs::PrefRegistrySyncable* registry) { 58 user_prefs::PrefRegistrySyncable* registry) {
59 registry->RegisterDictionaryPref(kPreferenceMACs); 59 registry->RegisterDictionaryPref(kPreferenceMACs);
60 registry->RegisterStringPref(kSuperMACPref, std::string()); 60 registry->RegisterStringPref(kSuperMACPref, std::string());
61 } 61 }
62 62
63 std::string DictionaryHashStoreContents::hash_store_id() const {
64 return "";
65 }
66
67 void DictionaryHashStoreContents::Reset() { 63 void DictionaryHashStoreContents::Reset() {
68 storage_->Remove(kPreferenceMACs, NULL); 64 storage_->Remove(kPreferenceMACs, NULL);
69 } 65 }
70 66
71 bool DictionaryHashStoreContents::IsInitialized() const { 67 bool DictionaryHashStoreContents::IsInitialized() const {
72 return storage_->GetDictionary(kPreferenceMACs, NULL); 68 return storage_->GetDictionary(kPreferenceMACs, NULL);
73 } 69 }
74 70
75 const base::DictionaryValue* DictionaryHashStoreContents::GetContents() const { 71 const base::DictionaryValue* DictionaryHashStoreContents::GetContents() const {
76 const base::DictionaryValue* mac_dictionary = NULL; 72 const base::DictionaryValue* mac_dictionary = NULL;
77 storage_->GetDictionary(kPreferenceMACs, &mac_dictionary); 73 storage_->GetDictionary(kPreferenceMACs, &mac_dictionary);
78 return mac_dictionary; 74 return mac_dictionary;
79 } 75 }
80 76
81 std::unique_ptr<HashStoreContents::MutableDictionary> 77 std::unique_ptr<HashStoreContents::MutableDictionary>
82 DictionaryHashStoreContents::GetMutableContents() { 78 DictionaryHashStoreContents::GetMutableContents() {
83 return std::unique_ptr<MutableDictionary>( 79 return std::unique_ptr<MutableDictionary>(
84 new MutablePreferenceMacDictionary(storage_)); 80 new MutablePreferenceMacDictionary(storage_));
85 } 81 }
86 82
87 std::string DictionaryHashStoreContents::GetSuperMac() const { 83 std::string DictionaryHashStoreContents::GetSuperMac() const {
88 std::string super_mac_string; 84 std::string super_mac_string;
89 storage_->GetString(kSuperMACPref, &super_mac_string); 85 storage_->GetString(kSuperMACPref, &super_mac_string);
90 return super_mac_string; 86 return super_mac_string;
91 } 87 }
92 88
93 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) { 89 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) {
94 storage_->SetString(kSuperMACPref, super_mac); 90 storage_->SetString(kSuperMACPref, super_mac);
95 } 91 }
OLDNEW
« no previous file with comments | « components/user_prefs/tracked/dictionary_hash_store_contents.h ('k') | components/user_prefs/tracked/hash_store_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698