diff options
author | Michael Kolb <kolby@google.com> | 2011-08-22 16:01:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-22 16:01:19 -0700 |
commit | 6628d14f087ba5554da08738e84b055b56070017 (patch) | |
tree | 804e3c02d1ea3a1256f6abc34cd48c52f5b224ea | |
parent | 1a51fecec2292d1c3389b9635968b1acda5785dd (diff) | |
parent | 2ae6ef7f6c146a5bc3a4c7ef8de56505eb02399e (diff) | |
download | packages_apps_browser-6628d14f087ba5554da08738e84b055b56070017.zip packages_apps_browser-6628d14f087ba5554da08738e84b055b56070017.tar.gz packages_apps_browser-6628d14f087ba5554da08738e84b055b56070017.tar.bz2 |
Merge "Avoid showing previous tab when closing an app tab"
-rw-r--r-- | src/com/android/browser/BaseUi.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/Controller.java | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index 6f87463..80f4de8 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -157,6 +157,9 @@ public abstract class BaseUi implements UI { public void onResume() { mActivityPaused = false; + // check if we exited without setting active tab + // b: 5188145 + setActiveTab(mTabControl.getCurrentTab()); } protected boolean isActivityPaused() { diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 3093085..386c483 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -2291,6 +2291,10 @@ public class Controller @Override public void closeCurrentTab() { + closeCurrentTab(false); + } + + protected void closeCurrentTab(boolean andQuit) { if (mTabControl.getTabCount() == 1) { mCrashRecoveryHandler.clearState(); mTabControl.removeTab(getCurrentTab()); @@ -2306,7 +2310,10 @@ public class Controller newTab = mTabControl.getTab(pos - 1); } } - if (switchToTab(newTab)) { + if (andQuit) { + mTabControl.setCurrentTab(newTab); + closeTab(current); + } else if (switchToTab(newTab)) { // Close window closeTab(current); } @@ -2406,7 +2413,7 @@ public class Controller closeTab(current); } else { if ((current.getAppId() != null) || current.closeOnBack()) { - closeCurrentTab(); + closeCurrentTab(true); } /* * Instead of finishing the activity, simply push this to the back |