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

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: 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..b8bd8b614913f80ece4104d61e047de2cb4f44f1 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,7 +452,8 @@ 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) {
+ int[] actionTypes, String[] actionTitles, Bitmap[] actionIcons,
+ String[] actionPlaceholders) {
if (actionTitles.length != actionIcons.length) {
Michael van Ouwerkerk 2016/04/06 13:27:35 Extend this bit for types and placeholders.
Nina 2016/04/06 16:05:49 Done.
throw new IllegalArgumentException("The number of action titles and icons must match.");
}
@@ -496,10 +497,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