summaryrefslogtreecommitdiff
path: root/chromium/components/search_provider_logos/google_logo_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/search_provider_logos/google_logo_api.h')
-rw-r--r--chromium/components/search_provider_logos/google_logo_api.h45
1 files changed, 35 insertions, 10 deletions
diff --git a/chromium/components/search_provider_logos/google_logo_api.h b/chromium/components/search_provider_logos/google_logo_api.h
index d1d85b9ba6f..3c3929eba4e 100644
--- a/chromium/components/search_provider_logos/google_logo_api.h
+++ b/chromium/components/search_provider_logos/google_logo_api.h
@@ -14,16 +14,41 @@
namespace search_provider_logos {
-// Implements AppendFingerprintToLogoURL, defined in logo_tracker.h, for Google
-// doodles.
-GURL GoogleAppendQueryparamsToLogoURL(const GURL& logo_url,
- const std::string& fingerprint,
- bool wants_cta,
- bool gray_background);
-
-// Implements ParseLogoResponse, defined in logo_tracker.h, for Google doodles.
-std::unique_ptr<EncodedLogo> GoogleParseLogoResponse(
- const std::unique_ptr<std::string>& response,
+// Returns the URL where the doodle can be downloaded, e.g.
+// https://www.google.com/async/newtab_mobile. This depends on the user's
+// Google domain.
+GURL GetGoogleDoodleURL(const GURL& google_base_url);
+
+// These return the correct callbacks for appending queryparams and parsing the
+// response ("Legacy" or "New"), based on the value of features::kUseDdljsonApi.
+AppendQueryparamsToLogoURL GetGoogleAppendQueryparamsCallback(
+ bool gray_background);
+ParseLogoResponse GetGoogleParseLogoResponseCallback(const GURL& base_url);
+
+// Implements AppendQueryparamsToLogoURL, defined in logo_tracker.h, for Google
+// doodles (old newtab_mobile API).
+GURL GoogleLegacyAppendQueryparamsToLogoURL(bool gray_background,
+ const GURL& logo_url,
+ const std::string& fingerprint);
+
+// Implements ParseLogoResponse, defined in logo_tracker.h, for Google doodles
+// (old newtab_mobile API).
+std::unique_ptr<EncodedLogo> GoogleLegacyParseLogoResponse(
+ std::unique_ptr<std::string> response,
+ base::Time response_time,
+ bool* parsing_failed);
+
+// Implements AppendQueryparamsToLogoURL, defined in logo_tracker.h, for Google
+// doodles (new ddljson API).
+GURL GoogleNewAppendQueryparamsToLogoURL(bool gray_background,
+ const GURL& logo_url,
+ const std::string& fingerprint);
+
+// Implements ParseLogoResponse, defined in logo_tracker.h, for Google doodles
+// (new ddljson API).
+std::unique_ptr<EncodedLogo> GoogleNewParseLogoResponse(
+ const GURL& base_url,
+ std::unique_ptr<std::string> response,
base::Time response_time,
bool* parsing_failed);