From 5adfb2a5905c9bb71978f45896f39a982ebcddbc Mon Sep 17 00:00:00 2001 From: huangs Date: Mon, 27 Apr 2015 14:14:20 -0700 Subject: [Local NTP] Fix chrome://large-icon fallback when no favicon is found. For chrome://large-icon, if no large icon is found then we get the small favicon to extract the dominant color for fallback background. If the favicon is missing we're supposed to have a gray background. This behavior was broken and this CL fixes it. BUG=467712 Review URL: https://codereview.chromium.org/1108833002 Cr-Commit-Position: refs/heads/master@{#327119} --- components/favicon_base/favicon_types.cc | 6 +++++- components/favicon_base/favicon_types.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'components/favicon_base') diff --git a/components/favicon_base/favicon_types.cc b/components/favicon_base/favicon_types.cc index e69f1d7..2ed5eb0 100644 --- a/components/favicon_base/favicon_types.cc +++ b/components/favicon_base/favicon_types.cc @@ -27,7 +27,11 @@ FaviconRawBitmapResult::~FaviconRawBitmapResult() {} // -------------------------------------------------------- // LargeIconResult -LargeIconResult::LargeIconResult() {} +LargeIconResult::LargeIconResult(const FaviconRawBitmapResult& bitmap_in) + : bitmap(bitmap_in) {} + +LargeIconResult::LargeIconResult(FallbackIconStyle* fallback_icon_style_in) + : fallback_icon_style(fallback_icon_style_in) {} LargeIconResult::~LargeIconResult() {} diff --git a/components/favicon_base/favicon_types.h b/components/favicon_base/favicon_types.h index f7c812a..469d0fa 100644 --- a/components/favicon_base/favicon_types.h +++ b/components/favicon_base/favicon_types.h @@ -79,7 +79,11 @@ typedef FaviconRawBitmapResult FaviconRawBitmapData; // either the bitmap data if the favicon database has a sufficiently large // favicon bitmap and the style of the fallback icon otherwise. struct LargeIconResult { - LargeIconResult(); + explicit LargeIconResult(const FaviconRawBitmapResult& bitmap_in); + + // Takes ownership of |fallback_icon_style_in|. + explicit LargeIconResult(FallbackIconStyle* fallback_icon_style_in); + ~LargeIconResult(); // The bitmap from the favicon database if the database has a sufficiently -- cgit v1.1