Index: chrome/browser/search/suggestions/suggestions_service.h |
diff --git a/chrome/browser/search/suggestions/suggestions_service.h b/chrome/browser/search/suggestions/suggestions_service.h |
index f74c4cbadf2b27d5b7c7a84129c659b2d7eca7aa..df1eec0c308040c27526d6e3b02a13bd635d72e8 100644 |
--- a/chrome/browser/search/suggestions/suggestions_service.h |
+++ b/chrome/browser/search/suggestions/suggestions_service.h |
@@ -5,6 +5,8 @@ |
#ifndef CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
#define CHROME_BROWSER_SEARCH_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
+#include <deque> |
Jered
2014/06/02 15:27:48
revert? I don't see a deque in this file.
manzagop (departed)
2014/06/02 16:20:13
Done.
|
+#include <string> |
#include <vector> |
#include "base/basictypes.h" |
@@ -25,6 +27,8 @@ namespace suggestions { |
extern const char kSuggestionsFieldTrialName[]; |
extern const char kSuggestionsFieldTrialURLParam[]; |
+extern const char kSuggestionsFieldTrialSuggestionsSuffixParam[]; |
+extern const char kSuggestionsFieldTrialBlacklistSuffixParam[]; |
extern const char kSuggestionsFieldTrialStateParam[]; |
extern const char kSuggestionsFieldTrialStateEnabled[]; |
@@ -51,6 +55,11 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate { |
const GURL& url, |
base::Callback<void(const GURL&, const SkBitmap*)> callback); |
+ // Issue a blacklist request. If there is already a blacklist request |
+ // in flight, the new blacklist request is ignored. |
+ void AddBlacklistedURL(const GURL& candidate_url, |
Jered
2014/06/02 15:27:48
nit: just BlacklistURL would be clearer
manzagop (departed)
2014/06/02 16:20:13
This was to be consistent with TopSites, but agree
|
+ ResponseCallback callback); |
+ |
private: |
FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, FetchSuggestionsData); |
@@ -62,6 +71,12 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate { |
// KeyedService implementation. |
virtual void Shutdown() OVERRIDE; |
+ // Determines whether |request| is a blacklisting request. |
+ bool IsBlacklistRequest(net::URLFetcher* request) const; |
+ |
+ // Creates a request to the suggestions service, properly setting headers. |
+ net::URLFetcher* CreateSuggestionsRequest(const GURL& url); |
+ |
// Contains the current suggestions fetch request. Will only have a value |
// while a request is pending, and will be reset by |OnURLFetchComplete|. |
scoped_ptr<net::URLFetcher> pending_request_; |
@@ -73,6 +88,9 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate { |
// The URL to fetch suggestions data from. |
GURL suggestions_url_; |
+ // Prefix for building the blacklisting URL. |
+ std::string blacklist_url_prefix_; |
+ |
// Queue of callbacks. These are flushed when fetch request completes. |
std::vector<ResponseCallback> waiting_requestors_; |