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

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

Issue 1864053002: Implement Android UI of web notification inline replies Base URL: https://chromium.googlesource.com/chromium/src.git@inline_replies_ps1
Patch Set: Fix filename? Created 4 years, 8 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/NotificationUIManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
index c7665997e2de3934b4e53ef3239a2a1d5ed0a5b7..8d652bc0ca2c96a91755a4097d7bbd885d47a580 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
@@ -452,9 +452,17 @@ public class NotificationUIManager {
private void displayNotification(long persistentNotificationId, String origin, String profileId,
boolean incognito, String tag, String title, String body, 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.");
+ int[] actionTypes, String[] actionTitles, Bitmap[] actionIcons,
+ String[] actionPlaceholders) {
+ if (actionTypes.length != actionTitles.length) {
+ throw new IllegalArgumentException("The number of action types and titles must match.");
+ }
+ if (actionTypes.length != actionIcons.length) {
+ throw new IllegalArgumentException("The number of action types and icons must match.");
+ }
+ if (actionTypes.length != actionPlaceholders.length) {
+ throw new IllegalArgumentException(
+ "The number of action types and placeholders must match.");
}
Resources res = mAppContext.getResources();
@@ -496,10 +504,13 @@ public class NotificationUIManager {
.setTimestamp(timestamp)
.setRenotify(renotify)
.setOrigin(UrlUtilities.formatUrlForSecurityDisplay(
- origin, false /* showScheme */));
+ origin, false /* showScheme */))
+ .setDefaultActionPlaceholder(res.getString(
+ R.string.notification_inline_reply_default_placeholder));
for (int actionIndex = 0; actionIndex < actionTitles.length; actionIndex++) {
- notificationBuilder.addAction(actionIcons[actionIndex], actionTitles[actionIndex],
+ notificationBuilder.addAction(actionTypes[actionIndex], actionIcons[actionIndex],
+ actionTitles[actionIndex], actionPlaceholders[actionIndex],
makePendingIntent(NotificationConstants.ACTION_CLICK_NOTIFICATION,
persistentNotificationId, origin, profileId,
incognito, tag, actionIndex));

Powered by Google App Engine
This is Rietveld 408576698