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

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

Issue 2699253003: Abstracting over Notification.Builder + NotificationCompat.Builder (Closed)
Patch Set: remove erroneously added methods from 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java » ('j') | 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/ChromeApplication.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
index 65275fcc18f0f679f1339960bfcf6d9ad2c26f01..b52b00a54695914f75394e7ece66c7a5cbaf68d7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
@@ -25,6 +25,9 @@ import org.chromium.chrome.browser.document.DocumentActivity;
import org.chromium.chrome.browser.document.IncognitoDocumentActivity;
import org.chromium.chrome.browser.init.InvalidStartupDialog;
import org.chromium.chrome.browser.metrics.UmaUtils;
+import org.chromium.chrome.browser.notifications.ChromeNotificationBuilder;
+import org.chromium.chrome.browser.notifications.NotificationBuilder;
+import org.chromium.chrome.browser.notifications.NotificationCompatBuilder;
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
import org.chromium.chrome.browser.preferences.PreferencesLauncher;
import org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPreferences;
@@ -194,4 +197,20 @@ public class ChromeApplication extends ContentApplication {
}
return sDocumentTabModelSelector;
}
+
+ /**
+ * Creates either a Notification.Builder or NotificationCompat.Builder under the hood, wrapped
+ * in our own common interface. Should be used for all notifications we create.
+ *
+ * TODO(awdf) Remove this once we've updated to revision 26 of the support library.
+ *
+ * @param preferCompat if a NotificationCompat.Builder is preferred.
+ * @param notificationCategoryGroupId
+ * @param notificationCategoryGroupName
+ */
+ public ChromeNotificationBuilder createChromeNotificationBuilder(boolean preferCompat,
+ String notificationCategoryId, String notificationCategoryName,
+ String notificationCategoryGroupId, String notificationCategoryGroupName) {
+ return preferCompat ? new NotificationCompatBuilder(this) : new NotificationBuilder(this);
+ }
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698