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

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

Issue 2076463002: [Custom Tabs] Implement "Read It Later" Behind a Flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 6 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
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 0948e20af680badaed2e89eece1d073fa412ac78..b4751144b52902aa0915b7ec7b29684f6b53f72a 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
@@ -16,6 +16,7 @@ import org.chromium.base.BuildInfo;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
+import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate;
import org.chromium.chrome.browser.share.ShareHelper;
import org.chromium.chrome.browser.tab.Tab;
@@ -104,11 +105,18 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
}
MenuItem openInChromeItem = menu.findItem(R.id.open_in_browser_id);
- try {
- openInChromeItem.setTitle(mDefaultBrowserFetcher.get());
- } catch (InterruptedException | ExecutionException e) {
- openInChromeItem.setTitle(
- mActivity.getString(R.string.menu_open_in_product_default));
+ MenuItem readItLaterItem = menu.findItem(R.id.read_it_later_id);
+ if (ChromeFeatureList.isEnabled("ReadItLaterInMenu")) {
+ // In the read-it-later experiment, Chrome will be the only browser to open the link
+ openInChromeItem.setTitle(R.string.menu_open_in_chrome);
+ } else {
+ readItLaterItem.setVisible(false);
+ try {
+ openInChromeItem.setTitle(mDefaultBrowserFetcher.get());
+ } catch (InterruptedException | ExecutionException e) {
+ openInChromeItem.setTitle(
+ mActivity.getString(R.string.menu_open_in_product_default));
+ }
}
// Add custom menu items. Make sure they are only added once.

Powered by Google App Engine
This is Rietveld 408576698