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

Unified Diff: components/search_provider_logos/logo_tracker.h

Issue 1066923002: [LogoTracker] Correct fingerprint append in async parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests and comment nits Created 5 years, 8 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
Index: components/search_provider_logos/logo_tracker.h
diff --git a/components/search_provider_logos/logo_tracker.h b/components/search_provider_logos/logo_tracker.h
index 1bfa40301263a3c124a5b7815c6e20eda6d4ddd5..182eed7d152689f4e69bad520fdfae417b7f9e6b 100644
--- a/components/search_provider_logos/logo_tracker.h
+++ b/components/search_provider_logos/logo_tracker.h
@@ -72,9 +72,9 @@ typedef base::Callback<
// Encodes the fingerprint of the cached logo in the logo URL. This enables the
// server to verify whether the cached logo is up-to-date.
-typedef base::Callback<
- GURL(const GURL& logo_url, const std::string& fingerprint)>
- AppendFingerprintToLogoURL;
+typedef base::Callback<GURL(const GURL& logo_url,
+ const std::string& fingerprint,
+ bool wants_cta)> AppendQueryparamsToLogoURL;
// This class provides the logo for a search provider. Logos are downloaded from
// the search provider's logo URL and cached on disk.
@@ -115,14 +115,15 @@ class LogoTracker : public net::URLFetcherDelegate {
// canceled.
//
// |parse_logo_response_func| is a callback that will be used to parse the
- // server's response into a EncodedLogo object. |append_fingerprint_func| is a
- // callback that will return the URL from which to download the logo if a
- // cached logo with a fingerprint is already available. Note:
- // |parse_logo_response_func| and |append_fingerprint_func| must be suitable
- // for running multiple times, concurrently, and on multiple threads.
+ // server's response into a EncodedLogo object. |append_queryparams_func| is a
+ // callback that will return the URL from which to download the logo.
+ // |wants_cta| determines if the url should return a call to action image.
+ // Note: |parse_logo_response_func| and |append_queryparams_func| must be
+ // suitable for running multiple times, concurrently, and on multiple threads.
void SetServerAPI(const GURL& logo_url,
const ParseLogoResponse& parse_logo_response_func,
- const AppendFingerprintToLogoURL& append_fingerprint_func);
+ const AppendQueryparamsToLogoURL& append_queryparams_func,
+ bool wants_cta);
// Retrieves the current search provider's logo from the local cache and/or
// over the network, and registers |observer| to be called when the cached
@@ -183,8 +184,12 @@ class LogoTracker : public net::URLFetcherDelegate {
// The function used to parse the logo response from the server.
ParseLogoResponse parse_logo_response_func_;
- // The function used to include the cached logo's fingerprint in the logo URL.
- AppendFingerprintToLogoURL append_fingerprint_func_;
+ // The function used to include the cached logo's fingerprint and call to
+ // action request in the logo URL.
+ AppendQueryparamsToLogoURL append_queryparams_func_;
+
+ // If |true| request call to action in server API.
+ bool wants_cta_;
// False if an asynchronous task is currently running.
bool is_idle_;
« no previous file with comments | « components/search_provider_logos/google_logo_api.cc ('k') | components/search_provider_logos/logo_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698