| 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/suggestions/blacklist_store.h" | 5 #include "components/suggestions/blacklist_store.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 // Swap |profile| and |filtered_profile|. | 208 // Swap |profile| and |filtered_profile|. |
| 209 profile->Swap(&filtered_profile); | 209 profile->Swap(&filtered_profile); |
| 210 } | 210 } |
| 211 | 211 |
| 212 // static | 212 // static |
| 213 void BlacklistStore::RegisterProfilePrefs( | 213 void BlacklistStore::RegisterProfilePrefs( |
| 214 user_prefs::PrefRegistrySyncable* registry) { | 214 user_prefs::PrefRegistrySyncable* registry) { |
| 215 registry->RegisterStringPref( | 215 registry->RegisterStringPref(prefs::kSuggestionsBlacklist, std::string()); |
| 216 prefs::kSuggestionsBlacklist, std::string(), | |
| 217 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 218 } | 216 } |
| 219 | 217 |
| 220 | 218 |
| 221 // Test seam. For simplicity of mock creation. | 219 // Test seam. For simplicity of mock creation. |
| 222 BlacklistStore::BlacklistStore() { | 220 BlacklistStore::BlacklistStore() { |
| 223 } | 221 } |
| 224 | 222 |
| 225 bool BlacklistStore::LoadBlacklist(SuggestionsBlacklist* blacklist) { | 223 bool BlacklistStore::LoadBlacklist(SuggestionsBlacklist* blacklist) { |
| 226 DCHECK(blacklist); | 224 DCHECK(blacklist); |
| 227 | 225 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 255 | 253 |
| 256 pref_service_->SetString(prefs::kSuggestionsBlacklist, base64_blacklist_data); | 254 pref_service_->SetString(prefs::kSuggestionsBlacklist, base64_blacklist_data); |
| 257 return true; | 255 return true; |
| 258 } | 256 } |
| 259 | 257 |
| 260 void BlacklistStore::ClearBlacklist() { | 258 void BlacklistStore::ClearBlacklist() { |
| 261 pref_service_->ClearPref(prefs::kSuggestionsBlacklist); | 259 pref_service_->ClearPref(prefs::kSuggestionsBlacklist); |
| 262 } | 260 } |
| 263 | 261 |
| 264 } // namespace suggestions | 262 } // namespace suggestions |
| OLD | NEW |