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

Unified Diff: chrome/browser/android/contextualsearch/contextual_search_delegate.cc

Issue 2343523002: [TTS] Request Now on Tap data in the Resolve request. (Closed)
Patch Set: Responded to Peters comments: inlined a conversion and a few other nits. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/search_engines/template_url.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/contextualsearch/contextual_search_delegate.cc
diff --git a/chrome/browser/android/contextualsearch/contextual_search_delegate.cc b/chrome/browser/android/contextualsearch/contextual_search_delegate.cc
index dd2c84327d5078492409dace0d43b98273bf6578..3a72b0ba79c815588cb2a39913d12bae01633b57 100644
--- a/chrome/browser/android/contextualsearch/contextual_search_delegate.cc
+++ b/chrome/browser/android/contextualsearch/contextual_search_delegate.cc
@@ -55,6 +55,9 @@ const char kDoPreventPreloadValue[] = "1";
// The number of characters that should be shown after the selected expression.
const int kSurroundingSizeForUI = 60;
+// The version of the Now on Tap API that we want to invoke.
+const int kNowOnTapVersion = 1;
+
} // namespace
// URLFetcher ID, only used for tests: we only have one kind of fetcher.
@@ -207,8 +210,12 @@ std::string ContextualSearchDelegate::BuildRequestUrl(std::string selection) {
TemplateURLRef::SearchTermsArgs search_terms_args =
TemplateURLRef::SearchTermsArgs(base::string16());
+ int now_on_tap_version =
+ field_trial_->IsNowOnTapBarIntegrationEnabled() ? kNowOnTapVersion : 0;
+
TemplateURLRef::SearchTermsArgs::ContextualSearchParams params(
- kContextualSearchRequestVersion, selected_text, "", true);
+ kContextualSearchRequestVersion, selected_text, std::string(),
+ now_on_tap_version);
search_terms_args.contextual_search_params = params;
« no previous file with comments | « no previous file | components/search_engines/template_url.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698