diff options
author | newt <newt@chromium.org> | 2015-04-23 15:02:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-23 22:02:42 +0000 |
commit | 3a171a20534963af96e28129c1019882afe83c97 (patch) | |
tree | 0b840ea2a61e771048ab00f114c349060c981f59 /components/search_provider_logos/google_logo_api.cc | |
parent | 1e5dd4e4a30f5a239c42630e2bf04e61bb7a6b24 (diff) | |
download | chromium_src-3a171a20534963af96e28129c1019882afe83c97.zip chromium_src-3a171a20534963af96e28129c1019882afe83c97.tar.gz chromium_src-3a171a20534963af96e28129c1019882afe83c97.tar.bz2 |
Fix metadata loss when revalidating search provider logo.
Previously, when revaliding a cached search provider's logo, the
mime_type of the image and the URL of the animated image to show (if
any) were dropped. This fixes those bugs and adds tests.
BUG=480090
Review URL: https://codereview.chromium.org/1088583005
Cr-Commit-Position: refs/heads/master@{#326664}
Diffstat (limited to 'components/search_provider_logos/google_logo_api.cc')
-rw-r--r-- | components/search_provider_logos/google_logo_api.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/search_provider_logos/google_logo_api.cc b/components/search_provider_logos/google_logo_api.cc index 0e7501f..f92e679 100644 --- a/components/search_provider_logos/google_logo_api.cc +++ b/components/search_provider_logos/google_logo_api.cc @@ -94,10 +94,6 @@ scoped_ptr<EncodedLogo> GoogleParseLogoResponse( logo->encoded_image = encoded_image_string; if (!logo_dict->GetString("mime_type", &logo->metadata.mime_type)) return scoped_ptr<EncodedLogo>(); - - // Existance of url indicates |data| is a call to action image for an - // animated doodle. |url| points to that animated doodle. - logo_dict->GetString("url", &logo->metadata.animated_url); } // Don't check return values since these fields are optional. @@ -105,6 +101,10 @@ scoped_ptr<EncodedLogo> GoogleParseLogoResponse( logo_dict->GetString("fingerprint", &logo->metadata.fingerprint); logo_dict->GetString("alt", &logo->metadata.alt_text); + // Existance of url indicates |data| is a call to action image for an + // animated doodle. |url| points to that animated doodle. + logo_dict->GetString("url", &logo->metadata.animated_url); + base::TimeDelta time_to_live; int time_to_live_ms; if (logo_dict->GetInteger("time_to_live", &time_to_live_ms)) { |