summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-12-15 11:19:39 -0500
committerCary Clark <cary@android.com>2010-12-15 15:24:17 -0500
commit043c2d63f65464e13a50e831f054a8f18414b9e6 (patch)
treebf67f9d05d9ee59a72fe42beddae708b8d739627 /src/com/android/browser
parent376b54116e38b3b94c4d64663d1bff38352b0e59 (diff)
downloadpackages_apps_Browser-043c2d63f65464e13a50e831f054a8f18414b9e6.zip
packages_apps_Browser-043c2d63f65464e13a50e831f054a8f18414b9e6.tar.gz
packages_apps_Browser-043c2d63f65464e13a50e831f054a8f18414b9e6.tar.bz2
extract anchor href and image src separately
Long pressing a link may return an anchor, an image, or an image in an anchor. Sometimes we want one, sometimes the other. Make both available so the context menu can choose. Companion changes are in external/webkit, frameworks/base bug:3282745 bug:3263340 Change-Id: I382044c3ec760f086ac3f973b09af332d5d5f544
Diffstat (limited to 'src/com/android/browser')
-rw-r--r--src/com/android/browser/Controller.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 11b6bd7..8483efa 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -434,6 +434,8 @@ public class Controller
{
String url = (String) msg.getData().get("url");
String title = (String) msg.getData().get("title");
+ String src = (String) msg.getData().get("src");
+ if (url == "") url = src; // use image if no anchor
if (TextUtils.isEmpty(url)) {
break;
}
@@ -445,9 +447,11 @@ public class Controller
}
switch (msg.arg1) {
case R.id.open_context_menu_id:
- case R.id.view_image_context_menu_id:
loadUrlFromContext(getCurrentTopWebView(), url);
break;
+ case R.id.view_image_context_menu_id:
+ loadUrlFromContext(getCurrentTopWebView(), src);
+ break;
case R.id.open_newtab_context_menu_id:
final Tab parent = mTabControl.getCurrentTab();
final Tab newTab = openTab(parent, url, false);