summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVictoria Lease <violets@google.com>2012-03-14 07:54:05 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-14 07:54:05 -0700
commitb901986739155a423884055f0f8c8511a097194b (patch)
treedf2460ea345f574827bf9545054a0a1ac6064676 /src
parenta32565f7f6fbe722b5aa7674e039e305d3a41693 (diff)
parent5987b806b08b9511d139555d529bbe11ddbdc8b4 (diff)
downloadpackages_apps_Browser-b901986739155a423884055f0f8c8511a097194b.zip
packages_apps_Browser-b901986739155a423884055f0f8c8511a097194b.tar.gz
packages_apps_Browser-b901986739155a423884055f0f8c8511a097194b.tar.bz2
Merge "Add "Share" option back to context menu for images."
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Controller.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 0b49aff..9861184 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -1403,8 +1403,20 @@ public class Controller
}
// otherwise fall through to handle image part
case WebView.HitTestResult.IMAGE_TYPE:
+ MenuItem shareItem = menu.findItem(R.id.share_link_context_menu_id);
+ shareItem.setVisible(type == WebView.HitTestResult.IMAGE_TYPE);
if (type == WebView.HitTestResult.IMAGE_TYPE) {
menu.setHeaderTitle(extra);
+ shareItem.setOnMenuItemClickListener(
+ new MenuItem.OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ sharePage(mActivity, null, extra, null,
+ null);
+ return true;
+ }
+ }
+ );
}
menu.findItem(R.id.view_image_context_menu_id)
.setOnMenuItemClickListener(new OnMenuItemClickListener() {