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

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java

Issue 738693002: Opening new "about:blank" tab if all tabs are closed in tab switcher mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correcting indentation Created 6 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java
index 36261cc03b48cde3361d813bbba1723c9ce3fe37..6be0839d8eca2c47ff60e6d445a385c81d749132 100644
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java
+++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.java
@@ -56,7 +56,10 @@ public class TabManager extends LinearLayout {
@Override
public void willCloseTab(Tab tab, boolean animate) {
- if (tab == mCurrentTab) setCurrentTab(null);
+ if (tab == mCurrentTab) {
+ setCurrentTab(null);
+ ensureTabExists();
+ }
}
};
@@ -125,7 +128,7 @@ public class TabManager extends LinearLayout {
* Ensures that at least one tab exists, by opening a new one if necessary.
*/
public void ensureTabExists() {
- if (mTabModelSelector.getCurrentModel().getCount() == 0) {
+ if (mTabModelSelector.getCurrentModel().getCount() == 1) {
Bernhard Bauer 2014/11/19 12:13:40 This also changes the semantics of existing code.
divya.bansal 2014/11/19 12:25:49 Yes thats true, actually in tabmodelbase.java getc
Bernhard Bauer 2014/11/19 12:54:39 I already told you what to do: in willCloseTab() (
divya.bansal 2014/11/19 14:48:39 Done.
createNewTab();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698