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

Unified Diff: components/favicon/core/large_icon_service.cc

Issue 1108833002: [Local NTP] Fix chrome://large-icon fallback when no favicon is found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring constructors. 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
« no previous file with comments | « no previous file | components/favicon_base/favicon_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 702761c82d8adc1a3510a8deb612b157f406dc93..9aeb8e8976d8806772e6495c9cd4e645a35c6128 100644
--- a/components/favicon/core/large_icon_service.cc
+++ b/components/favicon/core/large_icon_service.cc
@@ -45,9 +45,9 @@ void LargeIconService::RunLargeIconCallback(
const favicon_base::FaviconRawBitmapResult& bitmap_result) {
// If there are no bitmaps, return a result with an empty |bitmap| and a
// default |fallback_icon_style|.
- favicon_base::LargeIconResult result;
if (!bitmap_result.is_valid()) {
- callback.Run(result);
+ callback.Run(
+ favicon_base::LargeIconResult(new favicon_base::FallbackIconStyle()));
return;
}
@@ -59,7 +59,7 @@ void LargeIconService::RunLargeIconCallback(
bitmap_result.pixel_size.width() != bitmap_result.pixel_size.height()) {
// TODO(beaudoin): Resize the icon if it's large enough. Alternatively,
// return it and let the HTML resize it.
- result.fallback_icon_style.reset(new favicon_base::FallbackIconStyle());
+ favicon_base::LargeIconResult result(new favicon_base::FallbackIconStyle());
favicon_base::SetDominantColorAsBackground(
bitmap_result.bitmap_data, result.fallback_icon_style.get());
callback.Run(result);
@@ -70,8 +70,7 @@ void LargeIconService::RunLargeIconCallback(
// it.
// TODO(beaudoin): Resize the icon if it's too large. Alternatively, return
// it and let the HTML resize it.
- result.bitmap = bitmap_result;
- callback.Run(result);
+ callback.Run(favicon_base::LargeIconResult(bitmap_result));
}
} // namespace favicon
« no previous file with comments | « no previous file | components/favicon_base/favicon_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698