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

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

Issue 2702963002: Migrating media notifications to ChromeNotificationBuilder (Closed)
Patch Set: remove that unecessary method from all the places Created 3 years, 10 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/java/src/org/chromium/chrome/browser/notifications/NotificationBuilder.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationCompatBuilder.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationCompatBuilder.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationCompatBuilder.java
index 78034fdce28342dc31ec3a67f661260a59203e08..14b4950d1e96e8ce843ec6ec9295d9ac42618f17 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationCompatBuilder.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationCompatBuilder.java
@@ -9,7 +9,8 @@ import android.app.PendingIntent;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Icon;
-import android.support.v4.app.NotificationCompat;
+import android.support.v4.media.session.MediaSessionCompat;
+import android.support.v7.app.NotificationCompat;
import android.widget.RemoteViews;
/**
@@ -195,6 +196,18 @@ public class NotificationCompatBuilder implements ChromeNotificationBuilder {
}
@Override
+ public ChromeNotificationBuilder setMediaStyle(MediaSessionCompat session, int[] actions,
+ PendingIntent intent, boolean showCancelButton) {
+ NotificationCompat.MediaStyle style = new NotificationCompat.MediaStyle();
+ style.setMediaSession(session.getSessionToken());
+ style.setShowActionsInCompactView(actions);
+ style.setCancelButtonIntent(intent);
+ style.setShowCancelButton(showCancelButton);
+ mBuilder.setStyle(style);
+ return this;
+ }
+
+ @Override
public Notification buildWithBigContentView(RemoteViews view) {
return mBuilder.setCustomBigContentView(view).build();
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilder.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698