| Index: android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java
|
| diff --git a/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java b/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java
|
| index a3cad3c685c8845d74174a5d40b48f5079af7f62..c8b3ae75e7903f68545beb872fadb7dad0d1a847 100644
|
| --- a/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java
|
| +++ b/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java
|
| @@ -184,6 +184,23 @@ public class WebViewBrowserActivity extends Activity implements PopupMenu.OnMenu
|
|
|
| String url = getUrlFromIntent(getIntent());
|
| if (url == null) {
|
| + mWebView.restoreState(savedInstanceState);
|
| + url = mWebView.getUrl();
|
| + if (url != null) {
|
| + // If we have restored state, and that state includes
|
| + // a loaded URL, we reload. This allows us to keep the
|
| + // scroll offset, and also doesn't add an additional
|
| + // navigation history entry.
|
| + setUrlBarText(url);
|
| + // The immediately previous loadUrlFromurlbar must
|
| + // have got as far as calling loadUrl, so there is no
|
| + // URI parsing error at this point.
|
| + setUrlFail(false);
|
| + hideKeyboard(mUrlBar);
|
| + mWebView.reload();
|
| + mWebView.requestFocus();
|
| + return;
|
| + }
|
| // Make sure to load a blank page to make it immediately inspectable with
|
| // chrome://inspect.
|
| url = "about:blank";
|
| @@ -194,6 +211,12 @@ public class WebViewBrowserActivity extends Activity implements PopupMenu.OnMenu
|
| }
|
|
|
| @Override
|
| + public void onSaveInstanceState(Bundle savedInstanceState) {
|
| + // Deliberately don't catch TransactionTooLargeException here.
|
| + mWebView.saveState(savedInstanceState);
|
| + }
|
| +
|
| + @Override
|
| public void onBackPressed() {
|
| if (mWebView.canGoBack()) {
|
| mWebView.goBack();
|
|
|