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

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

Issue 554213003: Request the icon of a Web Notification in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the tests Created 6 years, 3 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/desktop_notification_service.cc
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index b05d1df49648913f2c64756f88b65f9680cbfb87..51a178e0eef1bcf8743107fb171355e00b175b7c 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -164,9 +164,14 @@ void DesktopNotificationService::ShowDesktopNotification(
base::string16 display_source = DisplayNameForOriginInProcessId(
origin, render_frame_host->GetProcess()->GetID());
- Notification notification(origin, params.icon_url, params.title,
- params.body, params.direction, display_source, params.replace_id,
- proxy);
+
+ // TODO(peter): Icons for Web Notifications are currently always requested for
+ // 1x scale, whereas the displays on which they can be displayed can have a
+ // different pixel density. Be smarter about this when the API gets updated
+ // with a way for developers to specify images of different resolutions.
+ Notification notification(origin, params.title, params.body,
+ gfx::Image::CreateFrom1xBitmap(params.icon),
+ display_source, params.replace_id, proxy);
// The webkit notification doesn't timeout.
notification.set_never_timeout(true);

Powered by Google App Engine
This is Rietveld 408576698