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

Side by Side Diff: components/suggestions/blacklist_store.cc

Issue 410673002: [Suggestions] Moving suggestions code to a new component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix deps Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/suggestions/blacklist_store.h ('k') | components/suggestions/blacklist_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698