| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.notifications; | 5 package org.chromium.chrome.browser.notifications; |
| 6 | 6 |
| 7 import android.app.Notification; | 7 import android.app.Notification; |
| 8 import android.app.PendingIntent; | 8 import android.app.PendingIntent; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| 11 import android.graphics.drawable.Icon; | 11 import android.graphics.drawable.Icon; |
| 12 import android.os.Bundle; |
| 12 import android.support.v4.media.session.MediaSessionCompat; | 13 import android.support.v4.media.session.MediaSessionCompat; |
| 13 import android.support.v7.app.NotificationCompat; | 14 import android.support.v7.app.NotificationCompat; |
| 14 import android.widget.RemoteViews; | 15 import android.widget.RemoteViews; |
| 15 | 16 |
| 16 /** | 17 /** |
| 17 * Wraps a NotificationCompat.Builder object. | 18 * Wraps a NotificationCompat.Builder object. |
| 18 */ | 19 */ |
| 19 public class NotificationCompatBuilder implements ChromeNotificationBuilder { | 20 public class NotificationCompatBuilder implements ChromeNotificationBuilder { |
| 20 private final NotificationCompat.Builder mBuilder; | 21 private final NotificationCompat.Builder mBuilder; |
| 21 | 22 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return this; | 78 return this; |
| 78 } | 79 } |
| 79 | 80 |
| 80 @Override | 81 @Override |
| 81 public ChromeNotificationBuilder setGroupSummary(boolean isGroupSummary) { | 82 public ChromeNotificationBuilder setGroupSummary(boolean isGroupSummary) { |
| 82 mBuilder.setGroupSummary(isGroupSummary); | 83 mBuilder.setGroupSummary(isGroupSummary); |
| 83 return this; | 84 return this; |
| 84 } | 85 } |
| 85 | 86 |
| 86 @Override | 87 @Override |
| 88 public ChromeNotificationBuilder addExtras(Bundle extras) { |
| 89 mBuilder.addExtras(extras); |
| 90 return this; |
| 91 } |
| 92 |
| 93 @Override |
| 87 public ChromeNotificationBuilder setOngoing(boolean ongoing) { | 94 public ChromeNotificationBuilder setOngoing(boolean ongoing) { |
| 88 mBuilder.setOngoing(ongoing); | 95 mBuilder.setOngoing(ongoing); |
| 89 return this; | 96 return this; |
| 90 } | 97 } |
| 91 | 98 |
| 92 @Override | 99 @Override |
| 93 public ChromeNotificationBuilder setVisibility(int visibility) { | 100 public ChromeNotificationBuilder setVisibility(int visibility) { |
| 94 mBuilder.setVisibility(visibility); | 101 mBuilder.setVisibility(visibility); |
| 95 return this; | 102 return this; |
| 96 } | 103 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 new NotificationCompat.BigTextStyle(mBuilder); | 225 new NotificationCompat.BigTextStyle(mBuilder); |
| 219 bigTextStyle.bigText(bigText); | 226 bigTextStyle.bigText(bigText); |
| 220 return bigTextStyle.build(); | 227 return bigTextStyle.build(); |
| 221 } | 228 } |
| 222 | 229 |
| 223 @Override | 230 @Override |
| 224 public Notification build() { | 231 public Notification build() { |
| 225 return mBuilder.build(); | 232 return mBuilder.build(); |
| 226 } | 233 } |
| 227 } | 234 } |
| OLD | NEW |