| 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 972cfce63ada136e3d84343cdcf43cd140f1c4e4..990a7101e52ca96a755978848ac03c2fecaaf001 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>
|
| +#include <string>
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| @@ -23,6 +25,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[];
|
|
|
| @@ -43,6 +47,11 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate {
|
| // fetch request completes.
|
| void FetchSuggestionsData(ResponseCallback callback);
|
|
|
| + // Issue a blacklist request. If there is already a blacklist request
|
| + // in-flight, the new blacklist request is ignored.
|
| + void AddBlacklistedURL(const std::string& candidate_url,
|
| + ResponseCallback callback);
|
| +
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, FetchSuggestionsData);
|
|
|
| @@ -54,6 +63,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_;
|
| @@ -65,6 +80,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_;
|
|
|
|
|