diff options
author | John Reck <jreck@google.com> | 2012-03-08 13:19:40 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-03-08 13:19:40 -0800 |
commit | 8b9bb8bf4df182b43b4b7b9293bcb7b1d8a2f3ae (patch) | |
tree | af7353f733f184cf98099d429afa455add6b945e /src | |
parent | 2cc8f6215927157ebdf60a7cc636fe29d2d565b6 (diff) | |
download | packages_apps_browser-8b9bb8bf4df182b43b4b7b9293bcb7b1d8a2f3ae.zip packages_apps_browser-8b9bb8bf4df182b43b4b7b9293bcb7b1d8a2f3ae.tar.gz packages_apps_browser-8b9bb8bf4df182b43b4b7b9293bcb7b1d8a2f3ae.tar.bz2 |
Fix restoring desktop useragent
Bug: 5911010
Change-Id: I84f94edbf29c9b17888ef5b24aa7c03712d22046
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/Tab.java | 16 |
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); } |