diff options
Diffstat (limited to 'src/com/android/browser/Tab.java')
| -rw-r--r-- | src/com/android/browser/Tab.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index 620028600..484357e0f 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -64,6 +64,7 @@ import android.webkit.WebView; import android.webkit.WebView.PictureListener; import android.webkit.WebViewClassic; import android.webkit.WebViewClient; +import android.webkit.WebViewClientClassicExt; import android.widget.CheckBox; import android.widget.Toast; @@ -155,6 +156,7 @@ class Tab implements PictureListener { // If true, the tab is in page loading state (after onPageStarted, // before onPageFinsihed) private boolean mInPageLoad; + private boolean mDisableOverrideUrlLoading; // The last reported progress of the current page private int mPageLoadProgress; // The time the load started, used to find load page time @@ -322,7 +324,7 @@ class Tab implements PictureListener { // WebViewClient implementation for the main WebView // ------------------------------------------------------------------------- - private final WebViewClient mWebViewClient = new WebViewClient() { + private final WebViewClientClassicExt mWebViewClient = new WebViewClientClassicExt() { private Message mDontResend; private Message mResend; @@ -372,6 +374,7 @@ class Tab implements PictureListener { @Override public void onPageFinished(WebView view, String url) { + mDisableOverrideUrlLoading = false; if (!isPrivateBrowsingEnabled()) { LogTag.logPageFinishedLoading( url, SystemClock.uptimeMillis() - mLoadStartTime); @@ -383,7 +386,7 @@ class Tab implements PictureListener { // return true if want to hijack the url to let another app to handle it @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { - if (mInForeground) { + if (!mDisableOverrideUrlLoading && mInForeground) { return mWebViewController.shouldOverrideUrlLoading(Tab.this, view, url); } else { @@ -1045,12 +1048,12 @@ class Tab implements PictureListener { // Subclass of WebViewClient used in subwindows to notify the main // WebViewClient of certain WebView activities. - private static class SubWindowClient extends WebViewClient { + private static class SubWindowClient extends WebViewClientClassicExt { // The main WebViewClient. - private final WebViewClient mClient; + private final WebViewClientClassicExt mClient; private final WebViewController mController; - SubWindowClient(WebViewClient client, WebViewController controller) { + SubWindowClient(WebViewClientClassicExt client, WebViewController controller) { mClient = client; mController = controller; } @@ -1894,6 +1897,10 @@ class Tab implements PictureListener { } } + public void disableUrlOverridingForLoad() { + mDisableOverrideUrlLoading = true; + } + protected void capture() { if (mMainView == null || mCapture == null) return; if (mMainView.getContentWidth() <= 0 || mMainView.getContentHeight() <= 0) { |
