| Index: components/favicon/core/large_icon_service.cc
|
| diff --git a/components/favicon/core/large_icon_service.cc b/components/favicon/core/large_icon_service.cc
|
| index 0153ddf34304ffb213863c0486a01a34ff20a270..ddfa1c16050a1df290a3261bb696ed280ff98d4a 100644
|
| --- a/components/favicon/core/large_icon_service.cc
|
| +++ b/components/favicon/core/large_icon_service.cc
|
| @@ -21,6 +21,7 @@
|
| #include "components/favicon_base/fallback_icon_style.h"
|
| #include "components/favicon_base/favicon_types.h"
|
| #include "components/favicon_base/favicon_util.h"
|
| +#include "components/image_fetcher/core/request_metadata.h"
|
| #include "skia/ext/image_operations.h"
|
| #include "ui/gfx/codec/png_codec.h"
|
| #include "ui/gfx/geometry/size.h"
|
| @@ -231,17 +232,18 @@ void OnFetchIconFromGoogleServerComplete(
|
| return;
|
| }
|
|
|
| - // TODO(crbug.com/699542): Extract the original icon url from the response
|
| - // headers if available and use it instead of |icon_url|. Possibly the type
|
| - // too, because using TOUCH_ICON is a hacky way that allows us to not
|
| - // interfere with sync.
|
| + // Get the original favicon URL from Content-Location http header (if given).
|
| + std::string original_icon_url = metadata.content_location_header;
|
| + if (original_icon_url.empty()) {
|
| + original_icon_url = icon_url; // Use the favicon server url as fallback.
|
| + }
|
|
|
| // Write fetched icons to FaviconService's cache, but only if no icon was
|
| // available (clients are encouraged to do this in advance, but meanwhile
|
| // something else could've been written). By marking the icons initially
|
| // expired (out-of-date), they will be refetched when we visit the original
|
| // page any time in the future.
|
| - favicon_service->SetLastResortFavicons(page_url, GURL(icon_url),
|
| + favicon_service->SetLastResortFavicons(page_url, GURL(original_icon_url),
|
| favicon_base::IconType::TOUCH_ICON,
|
| image, callback);
|
| }
|
|
|