summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2012-01-17 11:21:25 -0800
committerMichael Kolb <kolby@google.com>2012-01-17 12:36:22 -0800
commit91911a26058418e622950cffc616f99ada49df1d (patch)
treea5e3b260f8e8c80640e20c29f2425ca185c3774c /src
parent0755fcde2dfef68344188a02d16745f516547c69 (diff)
downloadpackages_apps_Browser-91911a26058418e622950cffc616f99ada49df1d.zip
packages_apps_Browser-91911a26058418e622950cffc616f99ada49df1d.tar.gz
packages_apps_Browser-91911a26058418e622950cffc616f99ada49df1d.tar.bz2
fix back key on tabs behavior
Bug: 5851422 5841282 don't restore back/forward list when re-creating a webview Change-Id: I4648ced38aafedb8e129f599f0ea28f7520da9b8
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Tab.java8
-rw-r--r--src/com/android/browser/TabControl.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index a7598c2..b09e423 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1501,11 +1501,15 @@ class Tab implements PictureListener {
return mId;
}
+ void setWebView(WebView w) {
+ setWebView(w, true);
+ }
+
/**
* Sets the WebView for this tab, correctly removing the old WebView from
* the container view.
*/
- void setWebView(WebView w) {
+ void setWebView(WebView w, boolean restore) {
if (mMainView == w) {
return;
}
@@ -1542,7 +1546,7 @@ class Tab implements PictureListener {
if (tc != null && tc.getOnThumbnailUpdatedListener() != null) {
mMainView.setPictureListener(this);
}
- if (mSavedState != null) {
+ if (restore && (mSavedState != null)) {
WebBackForwardList restoredState
= mMainView.restoreState(mSavedState);
if (restoredState == null || restoredState.getSize() == 0) {
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 0668b74..993cd11 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -613,7 +613,7 @@ class TabControl {
}
// Create a new WebView. If this tab is the current tab, we need to put
// back all the clients so force it to be the current tab.
- t.setWebView(createNewWebView());
+ t.setWebView(createNewWebView(), false);
if (getCurrentTab() == t) {
setCurrentTab(t, true);
}