diff options
author | Victoria Lease <violets@google.com> | 2012-03-14 07:54:05 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-14 07:54:05 -0700 |
commit | b901986739155a423884055f0f8c8511a097194b (patch) | |
tree | df2460ea345f574827bf9545054a0a1ac6064676 /src | |
parent | a32565f7f6fbe722b5aa7674e039e305d3a41693 (diff) | |
parent | 5987b806b08b9511d139555d529bbe11ddbdc8b4 (diff) | |
download | packages_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.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() { |