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

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

Issue 2474273005: [Contextual Search] Add command line flag for contextual cards version override (Closed)
Patch Set: Created 4 years, 1 month 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 | no next file » | 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 7b07a3e3359a388e576932cd20b80b71dd5e81e7..f170cd054592562ec444ceae0a4a2a609bcf4aa7 100644
--- a/chrome/browser/android/contextualsearch/contextual_search_delegate.cc
+++ b/chrome/browser/android/contextualsearch/contextual_search_delegate.cc
@@ -72,6 +72,8 @@ const int kContextualCardsNoIntegration = 0;
const int kContextualCardsBarIntegration = 1;
const int kContextualCardsSingleAction = 2;
+const char kContextualCardsVersionOverride[] = "contextual_cards_version";
+
} // namespace
// URLFetcher ID, only used for tests: we only have one kind of fetcher.
@@ -235,6 +237,13 @@ std::string ContextualSearchDelegate::BuildRequestUrl(std::string selection) {
contextual_cards_version = kContextualCardsSingleAction;
}
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ kContextualCardsVersionOverride)){
+ contextual_cards_version =
+ std::stoi(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ kContextualCardsVersionOverride), nullptr);
+ }
+
TemplateURLRef::SearchTermsArgs::ContextualSearchParams params(
kContextualSearchRequestVersion, selected_text, std::string(),
contextual_cards_version);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698