summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/BaseUi.java3
-rw-r--r--src/com/android/browser/Controller.java11
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