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 "chrome/browser/search/suggestions/blacklist_store.h" | 5 #include "components/suggestions/blacklist_store.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "chrome/common/pref_names.h" | |
14 #include "components/pref_registry/pref_registry_syncable.h" | 13 #include "components/pref_registry/pref_registry_syncable.h" |
| 14 #include "components/suggestions/suggestions_pref_names.h" |
15 | 15 |
16 namespace suggestions { | 16 namespace suggestions { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 void PopulateBlacklistSet(const SuggestionsBlacklist& blacklist_proto, | 20 void PopulateBlacklistSet(const SuggestionsBlacklist& blacklist_proto, |
21 std::set<std::string>* blacklist_set) { | 21 std::set<std::string>* blacklist_set) { |
22 blacklist_set->clear(); | 22 blacklist_set->clear(); |
23 for (int i = 0; i < blacklist_proto.urls_size(); ++i) { | 23 for (int i = 0; i < blacklist_proto.urls_size(); ++i) { |
24 blacklist_set->insert(blacklist_proto.urls(i)); | 24 blacklist_set->insert(blacklist_proto.urls(i)); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 pref_service_->SetString(prefs::kSuggestionsBlacklist, base64_blacklist_data); | 167 pref_service_->SetString(prefs::kSuggestionsBlacklist, base64_blacklist_data); |
168 return true; | 168 return true; |
169 } | 169 } |
170 | 170 |
171 void BlacklistStore::ClearBlacklist() { | 171 void BlacklistStore::ClearBlacklist() { |
172 pref_service_->ClearPref(prefs::kSuggestionsBlacklist); | 172 pref_service_->ClearPref(prefs::kSuggestionsBlacklist); |
173 } | 173 } |
174 | 174 |
175 } // namespace suggestions | 175 } // namespace suggestions |
OLD | NEW |