From 5987b806b08b9511d139555d529bbe11ddbdc8b4 Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Mon, 12 Mar 2012 13:05:23 -0700 Subject: Add "Share" option back to context menu for images. Bug: 5904671 Change-Id: Id5b26035ddc8c04decc5f43ae4b859b396839a82 --- src/com/android/browser/Controller.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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() { -- cgit v1.1