Commit d52d2fed authored by Travis Skare's avatar Travis Skare Committed by Commit Bot

[omnibox] Provide default scope/endpoint values so experiment file isn't needed.

Remove an unneeded request - will need 1157167 to be merged at the same time.

Bug: 869687
Change-Id: Ic6f2d46a4aba1cb3535b9003c557e38080ccb7de
Reviewed-on: https://chromium-review.googlesource.com/1165955Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Travis Skare <skare@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581765}
parent 4be6d244
......@@ -74,8 +74,10 @@ void DocumentSuggestionsService::CreateDocumentSuggestionsRequest(
const TemplateURLService* template_url_service,
StartCallback start_callback,
CompletionCallback completion_callback) {
std::string endpoint = variations::GetVariationParamValueByFeature(
omnibox::kDocumentProvider, "Endpoint");
std::string endpoint = base::GetFieldTrialParamValueByFeature(
omnibox::kDocumentProvider, "DocumentProviderEndpoint");
if (endpoint.empty())
endpoint = "https://cloudsearch.googleapis.com/v1/query/search";
const GURL suggest_url = GURL(endpoint);
DCHECK(suggest_url.is_valid());
......@@ -111,16 +113,9 @@ void DocumentSuggestionsService::CreateDocumentSuggestionsRequest(
// TODO(https://crbug.com/808498) re-add data use measurement once
// SimpleURLLoader supports it.
// We should attach data_use_measurement::DataUseUserData::OMNIBOX.
StartDownloadAndTransferLoader(std::move(request), std::string(),
traffic_annotation, std::move(start_callback),
std::move(completion_callback));
// TODO(skare): Include code to catch token fetch in-progress; otherwise
// we'll lose one set of results.
// Create and fetch an OAuth2 token.
std::string scope = base::GetFieldTrialParamValueByFeature(
omnibox::kDocumentProvider, "OAuth2Scope");
std::string scope = "https://www.googleapis.com/auth/cloud_search.query";
OAuth2TokenService::ScopeSet scopes;
scopes.insert(scope);
token_fetcher_ = std::make_unique<identity::PrimaryAccountAccessTokenFetcher>(
......
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