Commit 312f5f1c authored by Tommy Li's avatar Tommy Li Committed by Commit Bot

[omnibox] RemoteSuggestionsService cleanup for removing custom endpoint

This CL just addresses some minor leftover cleanups from this CL:
https://chromium-review.googlesource.com/c/chromium/src/+/1761063

Bug: 995393
Change-Id: I099d20fdf5ff593e22c392f74f6f937dea4c97b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768667Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690059}
parent 7066cd22
...@@ -43,6 +43,22 @@ class RemoteSuggestionsService : public KeyedService { ...@@ -43,6 +43,22 @@ class RemoteSuggestionsService : public KeyedService {
base::OnceCallback<void(const network::SimpleURLLoader* source, base::OnceCallback<void(const network::SimpleURLLoader* source,
std::unique_ptr<std::string> response_body)>; std::unique_ptr<std::string> response_body)>;
// Returns a URL representing the address of the server where the zero suggest
// request is being sent. Does not take into account whether sending this
// request is prohibited (e.g. in an incognito window).
// Returns an invalid URL (i.e.: GURL::is_valid() == false) in case of an
// error.
//
// |search_terms_args| encapsulates the arguments sent to the suggest service.
// Various parts of it (including the current page URL and classification) are
// used to build the final endpoint URL. Note that the current page URL can
// be empty.
//
// Note that this method is public and is also used by ZeroSuggestProvider for
// suggestions that do not take the current page URL into consideration.
static GURL EndpointUrl(TemplateURLRef::SearchTermsArgs search_terms_args,
const TemplateURLService* template_url_service);
// Creates a loader for remote suggestions for |search_terms_args| and passes // Creates a loader for remote suggestions for |search_terms_args| and passes
// the loader to |start_callback|. It uses a number of signals to create the // the loader to |start_callback|. It uses a number of signals to create the
// loader, including field trial / experimental parameters, and it may // loader, including field trial / experimental parameters, and it may
...@@ -59,31 +75,12 @@ class RemoteSuggestionsService : public KeyedService { ...@@ -59,31 +75,12 @@ class RemoteSuggestionsService : public KeyedService {
// whatever function/class receives the callback. // whatever function/class receives the callback.
// //
// |completion_callback| will be invoked when the transfer is done. // |completion_callback| will be invoked when the transfer is done.
//
// This method sends a request for an OAuth2 token and temporarily
// instantiates |token_fetcher_|.
void CreateSuggestionsRequest( void CreateSuggestionsRequest(
const TemplateURLRef::SearchTermsArgs& search_terms_args, const TemplateURLRef::SearchTermsArgs& search_terms_args,
const TemplateURLService* template_url_service, const TemplateURLService* template_url_service,
StartCallback start_callback, StartCallback start_callback,
CompletionCallback completion_callback); CompletionCallback completion_callback);
// Returns a URL representing the address of the server where the zero suggest
// request is being sent. Does not take into account whether sending this
// request is prohibited (e.g. in an incognito window).
// Returns an invalid URL (i.e.: GURL::is_valid() == false) in case of an
// error.
//
// |search_terms_args| encapsulates the arguments sent to the suggest service.
// Various parts of it (including the current page URL and classification) are
// used to build the final endpoint URL. Note that the current page URL can
// be empty.
//
// Note that this method is public and is also used by ZeroSuggestProvider for
// suggestions that do not take the current page URL into consideration.
static GURL EndpointUrl(TemplateURLRef::SearchTermsArgs search_terms_args,
const TemplateURLService* template_url_service);
private: private:
// Activates a loader for |request|, wiring it up to |completion_callback|, // Activates a loader for |request|, wiring it up to |completion_callback|,
// and calls |start_callback|. If |request_body| isn't empty, it will be // and calls |start_callback|. If |request_body| isn't empty, it will be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment