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

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

Issue 2699253003: Abstracting over Notification.Builder + NotificationCompat.Builder (Closed)
Patch Set: Responding to comments Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.Notification; 8 import android.app.Notification;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 25 matching lines...) Expand all
36 import org.chromium.chrome.browser.help.HelpAndFeedback; 36 import org.chromium.chrome.browser.help.HelpAndFeedback;
37 import org.chromium.chrome.browser.historyreport.AppIndexingReporter; 37 import org.chromium.chrome.browser.historyreport.AppIndexingReporter;
38 import org.chromium.chrome.browser.init.InvalidStartupDialog; 38 import org.chromium.chrome.browser.init.InvalidStartupDialog;
39 import org.chromium.chrome.browser.instantapps.InstantAppsHandler; 39 import org.chromium.chrome.browser.instantapps.InstantAppsHandler;
40 import org.chromium.chrome.browser.locale.LocaleManager; 40 import org.chromium.chrome.browser.locale.LocaleManager;
41 import org.chromium.chrome.browser.media.VideoPersister; 41 import org.chromium.chrome.browser.media.VideoPersister;
42 import org.chromium.chrome.browser.metrics.UmaUtils; 42 import org.chromium.chrome.browser.metrics.UmaUtils;
43 import org.chromium.chrome.browser.metrics.VariationsSession; 43 import org.chromium.chrome.browser.metrics.VariationsSession;
44 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; 44 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
45 import org.chromium.chrome.browser.net.qualityprovider.ExternalEstimateProviderA ndroid; 45 import org.chromium.chrome.browser.net.qualityprovider.ExternalEstimateProviderA ndroid;
46 import org.chromium.chrome.browser.notifications.ChromeNotificationBuilder;
47 import org.chromium.chrome.browser.notifications.NotificationBuilder;
48 import org.chromium.chrome.browser.notifications.NotificationCompatBuilder;
46 import org.chromium.chrome.browser.omaha.RequestGenerator; 49 import org.chromium.chrome.browser.omaha.RequestGenerator;
47 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza tions; 50 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza tions;
48 import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient; 51 import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient;
49 import org.chromium.chrome.browser.policy.PolicyAuditor; 52 import org.chromium.chrome.browser.policy.PolicyAuditor;
50 import org.chromium.chrome.browser.preferences.LocationSettings; 53 import org.chromium.chrome.browser.preferences.LocationSettings;
51 import org.chromium.chrome.browser.preferences.PreferencesLauncher; 54 import org.chromium.chrome.browser.preferences.PreferencesLauncher;
52 import org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPrefe rences; 55 import org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPrefe rences;
53 import org.chromium.chrome.browser.preferences.password.SavePasswordsPreferences ; 56 import org.chromium.chrome.browser.preferences.password.SavePasswordsPreferences ;
54 import org.chromium.chrome.browser.rlz.RevenueStats; 57 import org.chromium.chrome.browser.rlz.RevenueStats;
55 import org.chromium.chrome.browser.services.AndroidEduOwnerCheckCallback; 58 import org.chromium.chrome.browser.services.AndroidEduOwnerCheckCallback;
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 * @param notificationId The id of the notification to show. 457 * @param notificationId The id of the notification to show.
455 * @param notification The {@link Notification} to show. 458 * @param notification The {@link Notification} to show.
456 */ 459 */
457 @SuppressWarnings("Unused") 460 @SuppressWarnings("Unused")
458 public void startServiceWithNotification( 461 public void startServiceWithNotification(
459 Intent intent, int notificationId, Notification notification) { 462 Intent intent, int notificationId, Notification notification) {
460 // TODO(dtrainor): Eventually make sure the service gets put into the fo reground with 463 // TODO(dtrainor): Eventually make sure the service gets put into the fo reground with
461 // {@link android.app.Service#startForeground(int, Notification)}. 464 // {@link android.app.Service#startForeground(int, Notification)}.
462 startService(intent); 465 startService(intent);
463 } 466 }
467
468 /**
469 * Creates either a Notification.Builder or NotificationCompat.Builder under the hood, wrapped
470 * in our own common interface. Should be used for all notifications we crea te.
471 *
472 * TODO(awdf) Remove this once we've updated to revision 26 of the support l ibrary.
473 *
474 * @param preferCompat if a NotificationCompat.Builder is preferred.
475 */
476 public ChromeNotificationBuilder createChromeNotificationBuilder(
477 boolean preferCompat, String notificationCategoryId, String notifica tionCategoryName) {
478 return preferCompat ? new NotificationCompatBuilder(this) : new Notifica tionBuilder(this);
479 }
464 } 480 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698