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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_api.cc

Issue 308053004: Add appIconMask to notification API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 6 years, 5 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 | chrome/common/extensions/api/notifications.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/notifications/notifications_api.cc
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index de01be5926024233eeb7c8d71aa14e4004706265..8bd5aee431d1acd4242d6d9af0cd317c1535ace8 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -285,6 +285,16 @@ bool NotificationsApiFunction::CreateNotification(
// Then, handle any optional data that's been provided.
message_center::RichNotificationData optional_fields;
+ if (options->app_icon_mask_url.get()) {
+ if (!NotificationBitmapToGfxImage(image_scale,
+ bitmap_sizes.app_icon_mask_size,
+ options->app_icon_mask_bitmap.get(),
+ &optional_fields.small_image)) {
+ SetError(kUnableToDecodeIconError);
+ return false;
+ }
+ }
+
if (options->priority.get())
optional_fields.priority = *options->priority;
@@ -402,6 +412,14 @@ bool NotificationsApiFunction::UpdateNotification(
notification->set_icon(icon);
}
+ gfx::Image app_icon_mask;
+ if (NotificationBitmapToGfxImage(image_scale,
+ bitmap_sizes.app_icon_mask_size,
+ options->app_icon_mask_bitmap.get(),
+ &app_icon_mask)) {
+ notification->set_small_image(app_icon_mask);
+ }
+
if (options->priority)
notification->set_priority(*options->priority);
« no previous file with comments | « no previous file | chrome/common/extensions/api/notifications.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698