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

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

Issue 2899053004: [Home] Ensure incognito tab model is created when NTP opened (Closed)
Patch Set: Close bottom sheet after loading URL/opening new tab Created 3 years, 7 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/incognito/IncognitoNotificationService.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/ChromeTabbedActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
index 4a857b1a9c4a807aa7251adafae7c07af2404407..19f20db54332a7db026e1f537e8da83b2047ff74 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -452,8 +452,9 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
// Check for incognito tabs to handle the case where Chrome was swiped away in the
// background.
- int incognitoCount = TabWindowManager.getInstance().getIncognitoTabCount();
- if (incognitoCount == 0) IncognitoNotificationManager.dismissIncognitoNotification();
+ if (TabWindowManager.getInstance().canDestroyIncognitoProfile()) {
+ IncognitoNotificationManager.dismissIncognitoNotification();
+ }
// LocaleManager can only function after the native library is loaded.
mLocaleManager = LocaleManager.getInstance();
@@ -506,7 +507,7 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
// any have incognito tabs exist. If all are alive and no tabs exist, we should ensure that
// we delete the incognito profile if one is around still.
if (tabbedModeTaskIds.size() == 0) {
- return TabWindowManager.getInstance().getIncognitoTabCount() == 0
+ return TabWindowManager.getInstance().canDestroyIncognitoProfile()
&& Profile.getLastUsedProfile().hasOffTheRecordProfile();
}
@@ -1034,11 +1035,14 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
}
if (getBottomSheet() != null) {
- if (getBottomSheet().isShowingNewTab()) {
+ // If the bottom sheet new tab UI is showing and the tab open type is not
+ // already OPEN_NEW_TAB or OPEN_NEW_INCOGNITO_TAB, set the open type so that a real
+ // new tab will be created and added to the appropriate model.
+ if (getBottomSheet().isShowingNewTab() && tabOpenType != TabOpenType.OPEN_NEW_TAB
+ && tabOpenType != TabOpenType.OPEN_NEW_INCOGNITO_TAB) {
tabOpenType = mTabModelSelectorImpl.isIncognitoSelected()
? TabOpenType.OPEN_NEW_INCOGNITO_TAB
: TabOpenType.OPEN_NEW_TAB;
- getBottomSheet().onProcessUrlViewIntent();
}
// Either a new tab is opening, a tab is being clobbered, or a tab is being brought
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698