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

Unified Diff: components/search_provider_logos/google_logo_api.cc

Issue 1962013002: Adding a parameter that will be used to request a transparent doodle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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_provider_logos/google_logo_api.h ('k') | components/search_provider_logos/logo_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_provider_logos/google_logo_api.cc
diff --git a/components/search_provider_logos/google_logo_api.cc b/components/search_provider_logos/google_logo_api.cc
index cb11bddd9856e1f705136c39e9d930b1e272ed4f..d97966f19e16fd3d998c261d015915d161630f60 100644
--- a/components/search_provider_logos/google_logo_api.cc
+++ b/components/search_provider_logos/google_logo_api.cc
@@ -22,7 +22,8 @@ const char kResponsePreamble[] = ")]}'";
GURL GoogleAppendQueryparamsToLogoURL(const GURL& logo_url,
const std::string& fingerprint,
- bool wants_cta) {
+ bool wants_cta,
+ bool transparent) {
// Note: we can't just use net::AppendQueryParameter() because it escapes
// ":" to "%3A", but the server requires the colon not to be escaped.
// See: http://crbug.com/413845
@@ -35,14 +36,17 @@ GURL GoogleAppendQueryparamsToLogoURL(const GURL& logo_url,
query += "&";
query += "async=";
- if (!fingerprint.empty()) {
- query += "es_dfp:" + fingerprint;
- if (wants_cta)
- query += ",";
- }
- if (wants_cta) {
- query += "cta:1";
- }
+ std::vector<std::string> params;
+ if (!fingerprint.empty())
+ params.push_back("es_dfp:" + fingerprint);
+
+ if (wants_cta)
+ params.push_back("cta:1");
+
+ if (transparent)
+ params.push_back("transp:1");
+
+ query += base::JoinString(params, ",");
GURL::Replacements replacements;
replacements.SetQueryStr(query);
return logo_url.ReplaceComponents(replacements);
« no previous file with comments | « components/search_provider_logos/google_logo_api.h ('k') | components/search_provider_logos/logo_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698