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

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

Issue 2273033002: Add Notification images (Android without custom layouts) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@herodesktop
Patch Set: Fix EXTRA_PICTURE test 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notification_platform_bridge_android.cc
diff --git a/chrome/browser/notifications/notification_platform_bridge_android.cc b/chrome/browser/notifications/notification_platform_bridge_android.cc
index ab02b49c0eeb4f9ad63d13964cef00b0a7b642c7..a7d4b148c9a7d1969481d11455aad9f3d3f750db 100644
--- a/chrome/browser/notifications/notification_platform_bridge_android.cc
+++ b/chrome/browser/notifications/notification_platform_bridge_android.cc
@@ -204,6 +204,11 @@ void NotificationPlatformBridgeAndroid::Display(
ScopedJavaLocalRef<jstring> body =
ConvertUTF16ToJavaString(env, notification.message());
+ ScopedJavaLocalRef<jobject> image;
+ SkBitmap image_bitmap = notification.image().AsBitmap();
+ if (!image_bitmap.drawsNothing())
+ image = gfx::ConvertToJavaBitmap(&image_bitmap);
+
ScopedJavaLocalRef<jobject> notification_icon;
SkBitmap notification_icon_bitmap = notification.icon().AsBitmap();
if (!notification_icon_bitmap.drawsNothing())
@@ -231,7 +236,7 @@ void NotificationPlatformBridgeAndroid::Display(
Java_NotificationPlatformBridge_displayNotification(
env, java_object_, j_notification_id, j_origin, j_profile_id, incognito,
- tag, webapk_package, title, body, notification_icon, badge,
+ tag, webapk_package, title, body, image, notification_icon, badge,
vibration_pattern, notification.timestamp().ToJavaTime(),
notification.renotify(), notification.silent(), action_titles,
action_icons);
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698