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

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

Issue 1750083004: Add badge to web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/notification_ui_manager_android.cc
diff --git a/chrome/browser/notifications/notification_ui_manager_android.cc b/chrome/browser/notifications/notification_ui_manager_android.cc
index f1b8dc5e81f09821c763b6d0255c96227b52a9fd..163a54fad913cd07b14842a892621832f9481772 100644
--- a/chrome/browser/notifications/notification_ui_manager_android.cc
+++ b/chrome/browser/notifications/notification_ui_manager_android.cc
@@ -165,6 +165,11 @@ void NotificationUIManagerAndroid::Add(const Notification& notification,
if (!notification_icon_bitmap.drawsNothing())
notification_icon = gfx::ConvertToJavaBitmap(&notification_icon_bitmap);
+ ScopedJavaLocalRef<jobject> small_icon;
+ SkBitmap small_icon_bitmap = notification.small_image().AsBitmap();
+ if (!small_icon_bitmap.drawsNothing())
+ small_icon = gfx::ConvertToJavaBitmap(&small_icon_bitmap);
+
std::vector<base::string16> action_titles_vector;
for (const message_center::ButtonInfo& button : notification.buttons())
action_titles_vector.push_back(button.title);
@@ -183,9 +188,10 @@ void NotificationUIManagerAndroid::Add(const Notification& notification,
Java_NotificationUIManager_displayNotification(
env, java_object_.obj(), persistent_notification_id, origin.obj(),
profile_id.obj(), profile->IsOffTheRecord(), tag.obj(), title.obj(),
- body.obj(), notification_icon.obj(), vibration_pattern.obj(),
- notification.timestamp().ToJavaTime(), notification.renotify(),
- notification.silent(), action_titles.obj(), action_icons.obj());
+ body.obj(), notification_icon.obj(), small_icon.obj(),
+ vibration_pattern.obj(), notification.timestamp().ToJavaTime(),
+ notification.renotify(), notification.silent(), action_titles.obj(),
+ action_icons.obj());
regenerated_notification_infos_[persistent_notification_id] =
std::make_pair(origin_url.spec(), notification.tag());

Powered by Google App Engine
This is Rietveld 408576698