Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java

Issue 1509713004: Add a default share button to the menu of Custom Tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)));

Powered by Google App Engine
This is Rietveld 408576698