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

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: Updated comments and rebased only. 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') | components/search_engines/template_url.h » ('J')
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..9618f075f7f636c0ae8d848804c621249864e332 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;
Peter Kasting 2016/09/15 23:05:41 Nit: Consider defining this as close to its use (i
Donn Denman 2016/09/15 23:34:25 I'd rather leave this at the top of this file, sin
+
} // namespace
// URLFetcher ID, only used for tests: we only have one kind of fetcher.
@@ -207,8 +210,11 @@ 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, "", now_on_tap_version);
Peter Kasting 2016/09/15 23:05:41 Nit: While here: "" -> std::string()
Donn Denman 2016/09/15 23:34:25 Done.
search_terms_args.contextual_search_params = params;
« no previous file with comments | « no previous file | components/search_engines/template_url.h » ('j') | components/search_engines/template_url.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698