From 14e1ae2d7461de1e0b2434b18c5a139dcfb29b74 Mon Sep 17 00:00:00 2001 From: Russell Brenner Date: Wed, 12 Jan 2011 14:54:23 -0800 Subject: Fix 3337625 to follow link to Google Images Prior fix for 3296929 caused Images link to stop working. When the Activity Manager is not needed, the RLZ background task must load the URL itself. Change-Id: I10416c97b09fb560dad0cd9bb24673d24a22e0b8 --- src/com/android/browser/UrlHandler.java | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'src/com/android/browser/UrlHandler.java') diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java index cd0afeb3c..f39ac4b6b 100644 --- a/src/com/android/browser/UrlHandler.java +++ b/src/com/android/browser/UrlHandler.java @@ -120,7 +120,7 @@ public class UrlHandler { // AsyncTask. Although we are not overriding the URL load synchronously, // we guarantee that we will handle this URL load after the task executes, // so it's safe to just return true to WebCore now to stop its own loading. - new RLZTask(siteUri, view).execute(); + new RLZTask(tab, siteUri, view).execute(); return true; } } @@ -137,9 +137,7 @@ public class UrlHandler { return true; } - if (mController.isMenuDown()) { - mController.openTab(tab, url, false); - mActivity.closeOptionsMenu(); + if (handleMenuClick(tab, url)) { return true; } @@ -198,6 +196,19 @@ public class UrlHandler { return false; } + // In case a physical keyboard is attached, handle clicks with the menu key + // depressed by opening in a new tab + boolean handleMenuClick(Tab tab, String url) + { + if (mController.isMenuDown()) { + mController.openTab(tab, url, false); + mActivity.closeOptionsMenu(); + return true; + } + + return false; + } + // Url for issuing the uber token. private final static Uri ISSUE_AUTH_TOKEN_URL = Uri.parse( "https://www.google.com/accounts/IssueAuthToken?service=gaia&Session=false"); @@ -355,10 +366,12 @@ public class UrlHandler { } private class RLZTask extends AsyncTask { + private Tab mTab; private Uri mSiteUri; private WebView mWebView; - public RLZTask(Uri uri, WebView webView) { + public RLZTask(Tab tab, Uri uri, WebView webView) { + mTab = tab; mSiteUri = uri; mWebView = webView; } @@ -383,7 +396,12 @@ public class UrlHandler { } protected void onPostExecute(String result) { - startActivityForUrl(result); + // If the Activity Manager is not invoked, load the URL directly + if (!startActivityForUrl(result)) { + if (!handleMenuClick(mTab, result)) { + mController.loadUrl(mWebView, result); + } + } } } -- cgit v1.2.3