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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java

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
Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
index 2ba333681b009b5d32a542f826300813beb97772..21f25a8566e2eb443b20a747e47fd65c9c418c88 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
@@ -471,6 +471,7 @@ public class NotificationPlatformBridge {
* @param title Title to be displayed in the notification.
* @param body Message to be displayed in the notification. Will be trimmed to one line of
* text by the Android notification system.
+ * @param image Content image to be prominently displayed when the notification is expanded.
* @param icon Icon to be displayed in the notification. Valid Bitmap icons will be scaled to
* the platforms, whereas a default icon will be generated for invalid Bitmaps.
* @param badge An image to represent the notification in the status bar. It is also displayed
@@ -487,8 +488,8 @@ public class NotificationPlatformBridge {
@CalledByNative
private void displayNotification(String notificationId, String origin, String profileId,
boolean incognito, String tag, String webApkPackage, String title, String body,
- Bitmap icon, Bitmap badge, int[] vibrationPattern, long timestamp, boolean renotify,
- boolean silent, String[] actionTitles, Bitmap[] actionIcons) {
+ Bitmap image, Bitmap icon, Bitmap badge, int[] vibrationPattern, long timestamp,
+ boolean renotify, boolean silent, String[] actionTitles, Bitmap[] actionIcons) {
if (actionTitles.length != actionIcons.length) {
throw new IllegalArgumentException("The number of action titles and icons must match.");
}
@@ -522,6 +523,7 @@ public class NotificationPlatformBridge {
createNotificationBuilder()
.setTitle(title)
.setBody(body)
+ .setImage(image)
.setLargeIcon(ensureNormalizedIcon(icon, origin))
.setSmallIcon(R.drawable.ic_chrome)
.setSmallIcon(badge)

Powered by Google App Engine
This is Rietveld 408576698