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

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

Issue 1388483002: Implement the Notification `timestamp` property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 a993556902fa1c1655dea1c47a0775ad2ed81191..daa6663ef5ddc4b19109a3f4733fa2df18c92d09 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
@@ -420,6 +420,7 @@ public class NotificationUIManager {
* @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 vibrationPattern Vibration pattern following the Web Vibration syntax.
+ * @param timestamp The timestamp of the event for which the notification is being shown.
* @param silent Whether the default sound, vibration and lights should be suppressed.
* @param actionTitles Titles of actions to display alongside the notification.
* @see https://developer.android.com/reference/android/app/Notification.html
@@ -427,7 +428,7 @@ public class NotificationUIManager {
@CalledByNative
private void displayNotification(long persistentNotificationId, String origin, String profileId,
boolean incognito, String tag, String title, String body, Bitmap icon,
- int[] vibrationPattern, boolean silent, String[] actionTitles) {
+ int[] vibrationPattern, long timestamp, boolean silent, String[] actionTitles) {
Resources res = mAppContext.getResources();
// Record whether it's known whether notifications can be shown to the user at all.
@@ -463,6 +464,7 @@ public class NotificationUIManager {
.setContentIntent(clickIntent)
.setDeleteIntent(closeIntent)
.setTicker(createTickerText(title, body))
+ .setTimestamp(timestamp)
.setOrigin(UrlUtilities.formatUrlForSecurityDisplay(
origin, false /* showScheme */));

Powered by Google App Engine
This is Rietveld 408576698