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

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

Issue 1188213002: Making icon url for buttons in notification optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | no next file » | 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 17063dfd5e6caff646f6feeded9b71303aa7908d..273222b4145f86190085f3a66974a63f901e5268 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -294,12 +294,13 @@ bool NotificationsApiFunction::CreateNotification(
base::UTF8ToUTF16((*options->buttons)[i]->title));
extensions::api::notifications::NotificationBitmap* icon_bitmap_ptr =
(*options->buttons)[i]->icon_bitmap.get();
+ // As icon url for button is optional so icon_bitmap_ptr can be null.
Peter Beverloo 2015/06/22 13:00:12 nit: grammer. I personally wouldn't bother with th
if (icon_bitmap_ptr) {
NotificationConversionHelper::NotificationBitmapToGfxImage(
image_scale, bitmap_sizes.button_icon_size, *icon_bitmap_ptr,
&info.icon);
- optional_fields.buttons.push_back(info);
}
+ optional_fields.buttons.push_back(info);
}
}
@@ -430,12 +431,13 @@ bool NotificationsApiFunction::UpdateNotification(
base::UTF8ToUTF16((*options->buttons)[i]->title));
extensions::api::notifications::NotificationBitmap* icon_bitmap_ptr =
(*options->buttons)[i]->icon_bitmap.get();
+ // As icon url for button is optional so icon_bitmap_ptr can be null.
if (icon_bitmap_ptr) {
NotificationConversionHelper::NotificationBitmapToGfxImage(
image_scale, bitmap_sizes.button_icon_size, *icon_bitmap_ptr,
&button.icon);
- buttons.push_back(button);
}
+ buttons.push_back(button);
}
notification->set_buttons(buttons);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698