| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.incognito; | 5 package org.chromium.chrome.browser.incognito; |
| 6 | 6 |
| 7 import android.app.Notification; | 7 import android.app.Notification; |
| 8 import android.app.NotificationManager; | 8 import android.app.NotificationManager; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 | 10 |
| 11 import org.chromium.base.ContextUtils; | 11 import org.chromium.base.ContextUtils; |
| 12 import org.chromium.chrome.R; | 12 import org.chromium.chrome.R; |
| 13 import org.chromium.chrome.browser.notifications.ChannelDefinitions; | |
| 14 import org.chromium.chrome.browser.notifications.ChromeNotificationBuilder; | 13 import org.chromium.chrome.browser.notifications.ChromeNotificationBuilder; |
| 15 import org.chromium.chrome.browser.notifications.NotificationBuilderFactory; | 14 import org.chromium.chrome.browser.notifications.NotificationBuilderFactory; |
| 16 import org.chromium.chrome.browser.notifications.NotificationConstants; | 15 import org.chromium.chrome.browser.notifications.NotificationConstants; |
| 17 import org.chromium.chrome.browser.notifications.NotificationUmaTracker; | 16 import org.chromium.chrome.browser.notifications.NotificationUmaTracker; |
| 17 import org.chromium.chrome.browser.notifications.channels.ChannelDefinitions; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Manages the notification indicating that there are incognito tabs opened in D
ocument mode. | 20 * Manages the notification indicating that there are incognito tabs opened in D
ocument mode. |
| 21 */ | 21 */ |
| 22 public class IncognitoNotificationManager { | 22 public class IncognitoNotificationManager { |
| 23 private static final String INCOGNITO_TABS_OPEN_TAG = "incognito_tabs_open"; | 23 private static final String INCOGNITO_TABS_OPEN_TAG = "incognito_tabs_open"; |
| 24 private static final int INCOGNITO_TABS_OPEN_ID = 100; | 24 private static final int INCOGNITO_TABS_OPEN_ID = 100; |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * Shows the close all incognito notification. | 27 * Shows the close all incognito notification. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 57 /** | 57 /** |
| 58 * Dismisses the incognito notification. | 58 * Dismisses the incognito notification. |
| 59 */ | 59 */ |
| 60 public static void dismissIncognitoNotification() { | 60 public static void dismissIncognitoNotification() { |
| 61 Context context = ContextUtils.getApplicationContext(); | 61 Context context = ContextUtils.getApplicationContext(); |
| 62 NotificationManager nm = | 62 NotificationManager nm = |
| 63 (NotificationManager) context.getSystemService(Context.NOTIFIC
ATION_SERVICE); | 63 (NotificationManager) context.getSystemService(Context.NOTIFIC
ATION_SERVICE); |
| 64 nm.cancel(INCOGNITO_TABS_OPEN_TAG, INCOGNITO_TABS_OPEN_ID); | 64 nm.cancel(INCOGNITO_TABS_OPEN_TAG, INCOGNITO_TABS_OPEN_ID); |
| 65 } | 65 } |
| 66 } | 66 } |
| OLD | NEW |