diff options
| author | Russell Brenner <russellbrenner@google.com> | 2011-01-12 14:54:23 -0800 |
|---|---|---|
| committer | Russell Brenner <russellbrenner@google.com> | 2011-01-13 09:39:55 -0800 |
| commit | 14e1ae2d7461de1e0b2434b18c5a139dcfb29b74 (patch) | |
| tree | 75ce8977be9ec4c3d5d97315080520818d2583bd /src | |
| parent | b92bbb498f1eeab477d62632c235d0a68a4f4ea2 (diff) | |
| download | packages_apps_Browser-14e1ae2d7461de1e0b2434b18c5a139dcfb29b74.tar.gz packages_apps_Browser-14e1ae2d7461de1e0b2434b18c5a139dcfb29b74.tar.bz2 packages_apps_Browser-14e1ae2d7461de1e0b2434b18c5a139dcfb29b74.zip | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/browser/UrlHandler.java | 30 |
1 files changed, 24 insertions, 6 deletions
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<Void, Void, String> { + 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); + } + } } } |
