diff options
author | Victoria Lease <violets@google.com> | 2012-03-12 13:05:23 -0700 |
---|---|---|
committer | Victoria Lease <violets@google.com> | 2012-03-13 15:55:55 -0700 |
commit | 5987b806b08b9511d139555d529bbe11ddbdc8b4 (patch) | |
tree | 1b86cdaf6d093fabc8e4c452894f10562a23dc86 /src | |
parent | ab4e819cdabeddbe36f32de24f73ba10b331989e (diff) | |
download | packages_apps_Browser-5987b806b08b9511d139555d529bbe11ddbdc8b4.zip packages_apps_Browser-5987b806b08b9511d139555d529bbe11ddbdc8b4.tar.gz packages_apps_Browser-5987b806b08b9511d139555d529bbe11ddbdc8b4.tar.bz2 |
Add "Share" option back to context menu for images.
Bug: 5904671
Change-Id: Id5b26035ddc8c04decc5f43ae4b859b396839a82
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/Controller.java | 12 |
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() { |