diff options
author | Michael Kolb <kolby@google.com> | 2011-08-22 14:49:34 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-08-22 14:49:34 -0700 |
commit | 2ae6ef7f6c146a5bc3a4c7ef8de56505eb02399e (patch) | |
tree | 2014b4b9cedf61ef952cfe313283ffcbdb892213 /src/com/android | |
parent | 676c5c8cd7f6a70948baa11606753dffa96e8d1e (diff) | |
download | packages_apps_Browser-2ae6ef7f6c146a5bc3a4c7ef8de56505eb02399e.zip packages_apps_Browser-2ae6ef7f6c146a5bc3a4c7ef8de56505eb02399e.tar.gz packages_apps_Browser-2ae6ef7f6c146a5bc3a4c7ef8de56505eb02399e.tar.bz2 |
Avoid showing previous tab when closing an app tab
Bug: 5188145
skip setActiveTab when closing a tab launched from an app
set active tab in onResume
Change-Id: If602358a61690f15fe2e81a6b3d62d51ad15e16d
Diffstat (limited to 'src/com/android')
-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 84d7e36..e0bb6f2 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -2296,6 +2296,10 @@ public class Controller @Override public void closeCurrentTab() { + closeCurrentTab(false); + } + + protected void closeCurrentTab(boolean andQuit) { if (mTabControl.getTabCount() == 1) { mCrashRecoveryHandler.clearState(); mTabControl.removeTab(getCurrentTab()); @@ -2311,7 +2315,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); } @@ -2411,7 +2418,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 |