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

Unified Diff: components/search_engines/template_url.cc

Issue 2872453005: Add Yandex referral ID to search URL. (Closed)
Patch Set: Clear app data in test setup to remove initial locale set for search engines from previous runs. Created 3 years, 7 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 | « components/search_engines/template_url.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index b4fb151639c6799de44dc0008764ebc6a051e3c2..9df068a86b6effb4dae55137b48df4a9d0bd4800 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -649,6 +649,8 @@ bool TemplateURLRef::ParseParameter(size_t start,
replacements->push_back(Replacement(GOOGLE_SUGGEST_REQUEST_ID, start));
} else if (parameter == kGoogleUnescapedSearchTermsParameter) {
replacements->push_back(Replacement(GOOGLE_UNESCAPED_SEARCH_TERMS, start));
+ } else if (parameter == "yandex:referralID") {
+ replacements->push_back(Replacement(YANDEX_REFERRAL_ID, start));
} else if (parameter == "yandex:searchPath") {
switch (ui::GetDeviceFormFactor()) {
case ui::DEVICE_FORM_FACTOR_DESKTOP:
@@ -1125,6 +1127,13 @@ std::string TemplateURLRef::HandleReplacements(
#endif
break;
+ case YANDEX_REFERRAL_ID: {
+ std::string referral_id = search_terms_data.GetYandexReferralID();
+ if (!referral_id.empty())
+ HandleReplacement("clid", referral_id, *i, &url);
+ break;
+ }
+
default:
NOTREACHED();
break;
« no previous file with comments | « components/search_engines/template_url.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698