summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/BrowserActivity.java1
-rw-r--r--src/com/android/browser/Controller.java3
-rw-r--r--src/com/android/browser/IntentHandler.java8
-rw-r--r--src/com/android/browser/Tab.java8
-rw-r--r--src/com/android/browser/UrlHandler.java1
5 files changed, 20 insertions, 1 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 8511778..4166b11 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -43,6 +43,7 @@ public class BrowserActivity extends Activity {
public static final String ACTION_SHOW_BROWSER = "show_browser";
public static final String ACTION_RESTART = "--restart--";
private static final String EXTRA_STATE = "state";
+ public static final String EXTRA_DISABLE_URL_OVERRIDE = "disable_url_override";
private final static String LOGTAG = "browser";
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index ebfd56f..eefeffe 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -2574,6 +2574,9 @@ public class Controller
if (data.isPreloaded()) {
// this isn't called for preloaded tabs
} else {
+ if (t != null && data.mDisableUrlOverride) {
+ t.disableUrlOverridingForLoad();
+ }
loadUrl(t, data.mUrl, data.mHeaders);
}
}
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java
index e22c5dc..f0998a4 100644
--- a/src/com/android/browser/IntentHandler.java
+++ b/src/com/android/browser/IntentHandler.java
@@ -335,12 +335,14 @@ public class IntentHandler {
final Map<String, String> mHeaders;
final PreloadedTabControl mPreloadedTab;
final String mSearchBoxQueryToSubmit;
+ final boolean mDisableUrlOverride;
UrlData(String url) {
this.mUrl = url;
this.mHeaders = null;
this.mPreloadedTab = null;
this.mSearchBoxQueryToSubmit = null;
+ this.mDisableUrlOverride = false;
}
UrlData(String url, Map<String, String> headers, Intent intent) {
@@ -353,6 +355,12 @@ public class IntentHandler {
this.mHeaders = headers;
this.mPreloadedTab = preloaded;
this.mSearchBoxQueryToSubmit = searchBoxQueryToSubmit;
+ if (intent != null) {
+ mDisableUrlOverride = intent.getBooleanExtra(
+ BrowserActivity.EXTRA_DISABLE_URL_OVERRIDE, false);
+ } else {
+ mDisableUrlOverride = false;
+ }
}
boolean isEmpty() {
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 0cf598f..7cb00d9 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -156,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
@@ -373,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);
@@ -384,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 {
@@ -1895,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) {
diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java
index ac4b880..167d410 100644
--- a/src/com/android/browser/UrlHandler.java
+++ b/src/com/android/browser/UrlHandler.java
@@ -175,6 +175,7 @@ public class UrlHandler {
return false;
}
try {
+ intent.putExtra(BrowserActivity.EXTRA_DISABLE_URL_OVERRIDE, true);
if (mActivity.startActivityIfNeeded(intent, -1)) {
// before leaving BrowserActivity, close the empty child tab.
// If a new tab is created through JavaScript open to load this