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

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

Issue 2647593002: [Android] Add an option in CCT to disable star and download button (Closed)
Patch Set: nit Created 3 years, 11 months 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
index d262fd9e1cfba942fbc5338c125f123e56780d7e..4e474fa591572f32da2b1c2252cdb45d89089247 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -66,6 +66,14 @@ public class CustomTabIntentDataProvider {
public static final String EXTRA_INITIAL_BACKGROUND_COLOR =
"org.chromium.chrome.browser.customtabs.EXTRA_INITIAL_BACKGROUND_COLOR";
+ /** Extra that enables the client to disable the star button in menu. */
+ public static final String EXTRA_DISABLE_STAR_BUTTON =
+ "org.chromium.chrome.browser.customtabs.EXTRA_DISABLE_STAR_BUTTON";
+
+ /** Extra that enables the client to disable the download button in menu. */
+ public static final String EXTRA_DISABLE_DOWNLOAD_BUTTON =
+ "org.chromium.chrome.browser.customtabs.EXTRA_DISABLE_DOWNLOAD_BUTTON";
+
//TODO(yusufo): Move this to CustomTabsIntent.
/** Signals custom tabs to favor sending initial urls to external handler apps if possible. */
public static final String EXTRA_SEND_TO_EXTERNAL_DEFAULT_HANDLER =
@@ -87,6 +95,8 @@ public class CustomTabIntentDataProvider {
private final boolean mIsMediaViewer;
private final boolean mIsInfoPage;
private final int mInitialBackgroundColor;
+ private final boolean mDisableStar;
+ private final boolean mDisableDownload;
private int mToolbarColor;
private int mBottomBarColor;
@@ -169,6 +179,9 @@ public class CustomTabIntentDataProvider {
&& IntentUtils.safeGetBooleanExtra(intent, EXTRA_IS_MEDIA_VIEWER, false);
mIsInfoPage = mIsTrustedIntent
&& IntentUtils.safeGetBooleanExtra(intent, EXTRA_IS_INFO_PAGE, false);
+ mDisableStar = IntentUtils.safeGetBooleanExtra(intent, EXTRA_DISABLE_STAR_BUTTON, false);
+ mDisableDownload = IntentUtils.safeGetBooleanExtra(intent, EXTRA_DISABLE_DOWNLOAD_BUTTON,
+ false);
}
/**
@@ -484,4 +497,18 @@ public class CustomTabIntentDataProvider {
int getInitialBackgroundColor() {
return mInitialBackgroundColor;
}
+
+ /**
+ * @return Whether there should be a star button in the menu.
+ */
+ boolean shouldShowStarButton() {
+ return !mDisableStar;
+ }
+
+ /**
+ * @return Whether there should be a download button in the menu.
+ */
+ boolean shouldShowDownloadButton() {
+ return !mDisableDownload;
+ }
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698