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

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

Issue 2702023002: Migrate web notifications to ChromeNotificationBuilder (Closed)
Patch Set: rebase 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
Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java
index 76460297090d0211f6b33146d4a734ec70849a82..16ca6174268837b77aaa7467f7f02ec8597990a8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java
@@ -8,6 +8,8 @@ import android.app.Notification;
import android.content.Context;
import android.os.Build;
+import org.chromium.chrome.browser.ChromeApplication;
+
/**
* Builds a notification using the standard Notification.BigTextStyle layout.
*/
@@ -23,7 +25,17 @@ public class StandardNotificationBuilder extends NotificationBuilderBase {
public Notification build() {
// Note: this is not a NotificationCompat builder so be mindful of the
// API level of methods you call on the builder.
- Notification.Builder builder = new Notification.Builder(mContext);
+ // TODO(crbug.com/697104) We should probably use a Compat builder.
+ ChromeNotificationBuilder builder =
+ ((ChromeApplication) mContext.getApplicationContext())
+ .createChromeNotificationBuilder(false /* preferCompat */,
+ NotificationConstants.CATEGORY_ID_SITES,
+ mContext.getString(
+ org.chromium.chrome.R.string.notification_category_sites),
+ NotificationConstants.CATEGORY_GROUP_ID_GENERAL,
+ mContext.getString(org.chromium.chrome.R.string
+ .notification_category_group_general));
+
builder.setContentTitle(mTitle);
builder.setContentText(mBody);
builder.setSubText(mOrigin);

Powered by Google App Engine
This is Rietveld 408576698