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

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

Issue 2841193002: Implement privacy disclosure for an unbound webapk. (Closed)
Patch Set: nit Created 3 years, 7 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/NotificationBuilderBase.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
index 16fa66e7d17e0effe0777cb3a3276b7a4258a061..00a1069f3eb61c574b79e2b312c1db02e59f3600 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
@@ -107,6 +107,7 @@ public abstract class NotificationBuilderBase {
private final int mLargeIconWidthPx;
private final int mLargeIconHeightPx;
private final RoundedIconGenerator mIconGenerator;
+ protected final String mChannelId;
protected CharSequence mTitle;
protected CharSequence mBody;
@@ -123,15 +124,17 @@ public abstract class NotificationBuilderBase {
protected long[] mVibratePattern;
protected long mTimestamp;
protected boolean mRenotify;
-
+ protected int mPriority;
private Bitmap mLargeIcon;
- public NotificationBuilderBase(Resources resources) {
+ public NotificationBuilderBase(
+ Resources resources, @ChannelDefinitions.ChannelId String channelId) {
mLargeIconWidthPx =
resources.getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
mLargeIconHeightPx =
resources.getDimensionPixelSize(android.R.dimen.notification_large_icon_height);
mIconGenerator = createIconGenerator(resources);
+ mChannelId = channelId;
}
/**
@@ -300,6 +303,15 @@ public abstract class NotificationBuilderBase {
}
/**
+ * Sets the priority of the notification (if set to private, overrides |setDefaults| and
+ * |setVibrate|)
+ */
+ public NotificationBuilderBase setPriority(int priority) {
+ mPriority = priority;
+ return this;
+ }
+
+ /**
* Sets the timestamp at which the event of the notification took place.
*/
public NotificationBuilderBase setTimestamp(long timestamp) {
@@ -362,8 +374,7 @@ public abstract class NotificationBuilderBase {
// Use a non-compat builder because we want the default small icon behaviour.
ChromeNotificationBuilder builder =
NotificationBuilderFactory
- .createChromeNotificationBuilder(
- false /* preferCompat */, ChannelDefinitions.CHANNEL_ID_SITES)
+ .createChromeNotificationBuilder(false /* preferCompat */, mChannelId)
.setContentText(context.getString(
org.chromium.chrome.R.string.notification_hidden_text))
.setSmallIcon(org.chromium.chrome.R.drawable.ic_chrome);

Powered by Google App Engine
This is Rietveld 408576698