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

Unified Diff: chrome/browser/notifications/platform_notification_service_impl.cc

Issue 2261283002: Add Notification images (Blink + desktop implementation) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: chrome/browser/notifications/platform_notification_service_impl.cc
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index 4408a1c00046141c983e0d286ed4a6e20fc1805d..7f12f43e917b064accce0664b534e43c5ef8b907 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -459,6 +459,13 @@ Notification PlatformNotificationServiceImpl::CreateNotificationFromData(
notification.set_renotify(notification_data.renotify);
notification.set_silent(notification_data.silent);
+ // TODO(johnme): ensure image is not loaded when it will not be used.
Peter Beverloo 2016/08/22 20:11:07 I get why you have this TODO here, but this really
johnme 2016/08/23 14:59:49 Done. Moved the badge one too.
+ if (!notification_resources.image.drawsNothing()) {
+ notification.set_type(message_center::NOTIFICATION_TYPE_IMAGE);
+ notification.set_image(
+ gfx::Image::CreateFrom1xBitmap(notification_resources.image));
+ }
+
// Badges are only supported on Android, primarily because it's the only
// platform that makes good use of them in the status bar.
// TODO(mvanouwerkerk): ensure no badge is loaded when it will not be used.

Powered by Google App Engine
This is Rietveld 408576698