Chromium Code Reviews| 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 f5befd9974af8faf69ae5a3eb79d921d2491c555..30496ba50fabebec7d7264af006a522d69aeff4d 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 |
| @@ -8,7 +8,9 @@ import android.app.Notification; |
| 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.widget.RemoteViews; |
| /** |
| * Wraps a NotificationCompat.Builder object. |
| @@ -34,13 +36,13 @@ public class NotificationCompatBuilder implements ChromeNotificationBuilder { |
| } |
| @Override |
| - public ChromeNotificationBuilder setContentTitle(String title) { |
| + public ChromeNotificationBuilder setContentTitle(CharSequence title) { |
| mBuilder.setContentTitle(title); |
| return this; |
| } |
| @Override |
| - public ChromeNotificationBuilder setContentText(String text) { |
| + public ChromeNotificationBuilder setContentText(CharSequence text) { |
| mBuilder.setContentText(text); |
| return this; |
| } |
| @@ -52,7 +54,12 @@ public class NotificationCompatBuilder implements ChromeNotificationBuilder { |
| } |
| @Override |
| - public ChromeNotificationBuilder setTicker(String text) { |
| + public ChromeNotificationBuilder setSmallIcon(Icon icon) { |
| + return this; |
| + } |
| + |
| + @Override |
| + public ChromeNotificationBuilder setTicker(CharSequence text) { |
| mBuilder.setTicker(text); |
| return this; |
| } |
| @@ -88,12 +95,17 @@ public class NotificationCompatBuilder implements ChromeNotificationBuilder { |
| } |
| @Override |
| - public ChromeNotificationBuilder addAction(int icon, String title, PendingIntent intent) { |
| + public ChromeNotificationBuilder addAction(int icon, CharSequence title, PendingIntent intent) { |
| mBuilder.addAction(icon, title, intent); |
| return this; |
| } |
| @Override |
| + public ChromeNotificationBuilder addAction(Notification.Action action) { |
| + return this; |
| + } |
| + |
| + @Override |
| public ChromeNotificationBuilder setDeleteIntent(PendingIntent intent) { |
| mBuilder.setDeleteIntent(intent); |
| return this; |
| @@ -112,7 +124,7 @@ public class NotificationCompatBuilder implements ChromeNotificationBuilder { |
| } |
| @Override |
| - public ChromeNotificationBuilder setSubText(String text) { |
| + public ChromeNotificationBuilder setSubText(CharSequence text) { |
| mBuilder.setSubText(text); |
| return this; |
| } |
| @@ -142,6 +154,44 @@ public class NotificationCompatBuilder implements ChromeNotificationBuilder { |
| } |
| @Override |
| + public ChromeNotificationBuilder setDefaults(int defaults) { |
| + mBuilder.setDefaults(defaults); |
| + return this; |
| + } |
| + |
| + public ChromeNotificationBuilder setOnlyAlertOnce(boolean onlyAlertOnce) { |
| + mBuilder.setOnlyAlertOnce(onlyAlertOnce); |
| + return this; |
| + } |
| + |
| + @Override |
| + public ChromeNotificationBuilder setPublicVersion(Notification publicNotification) { |
| + mBuilder.setPublicVersion(publicNotification); |
| + return this; |
| + } |
| + |
| + @Override |
| + public ChromeNotificationBuilder setContent(RemoteViews views) { |
| + mBuilder.setCustomContentView(views); |
| + return this; |
| + } |
| + |
| + @Override |
| + public ChromeNotificationBuilder setStyle(Notification.BigPictureStyle style) { |
| + return this; |
|
Peter Beverloo
2017/02/20 01:10:20
Maybe "assert false; // unused" or something to c
awdf
2017/02/24 17:37:30
Done, and in the other places it where it no-ops.
|
| + } |
| + |
| + @Override |
| + public ChromeNotificationBuilder setStyle(Notification.BigTextStyle bigTextStyle) { |
| + return this; |
| + } |
| + |
| + @Override |
| + public Notification buildWithBigContentView(RemoteViews view) { |
| + return mBuilder.setCustomBigContentView(view).build(); |
| + } |
| + |
| + @Override |
| public Notification buildWithBigTextStyle(String bigText) { |
| NotificationCompat.BigTextStyle bigTextStyle = |
| new NotificationCompat.BigTextStyle(mBuilder); |