summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Tab.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 837ca47..acccb31 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1548,6 +1548,7 @@ class Tab implements PictureListener {
mMainView.setPictureListener(this);
}
if (restore && (mSavedState != null)) {
+ restoreUserAgent();
WebBackForwardList restoredState
= mMainView.restoreState(mSavedState);
if (restoredState == null || restoredState.getSize() == 0) {
@@ -2010,10 +2011,7 @@ class Tab implements PictureListener {
mId = b.getLong(ID);
mAppId = b.getString(APPID);
mCloseOnBack = b.getBoolean(CLOSEFLAG);
- if (b.getBoolean(USERAGENT)
- != mSettings.hasDesktopUseragent(getWebView())) {
- mSettings.toggleDesktopUseragent(getWebView());
- }
+ restoreUserAgent();
String url = b.getString(CURRURL);
String title = b.getString(CURRTITLE);
boolean incognito = b.getBoolean(INCOGNITO);
@@ -2026,6 +2024,16 @@ class Tab implements PictureListener {
}
}
+ private void restoreUserAgent() {
+ if (mMainView == null || mSavedState == null) {
+ return;
+ }
+ if (mSavedState.getBoolean(USERAGENT)
+ != mSettings.hasDesktopUseragent(mMainView)) {
+ mSettings.toggleDesktopUseragent(mMainView);
+ }
+ }
+
public void updateBookmarkedStatus() {
mDataController.queryBookmarkStatus(getUrl(), mIsBookmarkCallback);
}