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

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

Issue 1847063003: Show the close all incognito notification for tabbed mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: findbugs Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java
index a461cb233d1f8d83b8425b515accb47580d88b67..989c138eb82b6eba8f0612d86486adcb381fb07a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.tabmodel;
import org.chromium.base.ObserverList;
import org.chromium.base.ThreadUtils;
+import org.chromium.chrome.browser.incognito.IncognitoNotificationManager;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
@@ -50,6 +51,8 @@ public class OffTheRecordTabModel implements TabModel {
protected void ensureTabModelImpl() {
ThreadUtils.assertOnUiThread();
if (!(mDelegateModel instanceof EmptyTabModel)) return;
+
+ IncognitoNotificationManager.showIncognitoNotification();
mDelegateModel = mDelegate.createTabModel();
for (TabModelObserver observer : mObservers) {
mDelegateModel.addObserver(observer);
@@ -79,6 +82,8 @@ public class OffTheRecordTabModel implements TabModel {
// Only delete the incognito profile if there are no incognito tabs open in any tab
// model selector as the profile is shared between them.
if (profile != null && !mDelegate.doOffTheRecordTabsExist()) {
+ IncognitoNotificationManager.dismissIncognitoNotification();
+
profile.destroyWhenAppropriate();
}

Powered by Google App Engine
This is Rietveld 408576698