Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java |
index 0e6115b8477003774d5d15ff0269967cfc3ac5fb..9f5a4477cfa16ecac6d69a7b49a9ab75089a96fa 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java |
@@ -22,14 +22,17 @@ import java.util.Map; |
*/ |
public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegate { |
private boolean mIsCustomEntryAdded; |
+ private boolean mShowShare; |
private List<String> mMenuEntries; |
private Map<MenuItem, Integer> mItemToIndexMap = new HashMap<MenuItem, Integer>(); |
/** |
* Creates an {@link CustomTabAppMenuPropertiesDelegate} instance. |
*/ |
- public CustomTabAppMenuPropertiesDelegate(ChromeActivity activity, List<String> menuEntries) { |
+ public CustomTabAppMenuPropertiesDelegate(ChromeActivity activity, List<String> menuEntries, |
+ boolean showShare) { |
super(activity); |
mMenuEntries = menuEntries; |
+ mShowShare = showShare; |
} |
@Override |
@@ -43,6 +46,10 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat |
mReloadMenuItem.setIcon(R.drawable.btn_reload_stop); |
loadingStateChanged(currentTab.isLoading()); |
+ MenuItem shareItem = menu.findItem(R.id.share_menu_id); |
+ shareItem.setVisible(mShowShare); |
+ shareItem.setEnabled(mShowShare); |
+ |
MenuItem openInChromeItem = menu.findItem(R.id.open_in_chrome_id); |
openInChromeItem.setTitle(mActivity.getString(R.string.menu_open_in_product, |
mActivity.getString(R.string.app_name))); |