Commit 6a79bc34 authored by tedchoc's avatar tedchoc Committed by Commit bot

Remove find in page from CCT, remove bookmark star from Herbs

BUG=625315

Review-Url: https://codereview.chromium.org/2159133003
Cr-Commit-Position: refs/heads/master@{#406731}
parent df57caa8
......@@ -11,9 +11,6 @@
<item android:id="@+id/forward_menu_id"
android:title="@string/accessibility_menu_forward"
android:icon="@drawable/btn_forward"/>
<item android:id="@+id/bookmark_this_page_id"
android:title="@string/accessibility_menu_bookmark"
android:icon="@drawable/btn_star"/>
<item android:id="@+id/info_menu_id"
android:title="@string/accessibility_menu_info"
android:icon="@drawable/btn_info" />
......@@ -32,9 +29,6 @@
android:title="@null" />
</menu>
</item>
<item android:id="@+id/find_in_page_id"
android:title="@string/menu_find_in_page"
android:orderInCategory="2" />
<!-- Title is intentionally left blank in xml and will be set in java. -->
<item android:id="@+id/open_in_browser_id"
android:title=""
......
......@@ -40,7 +40,6 @@ import org.chromium.chrome.browser.IntentHandler.ExternalAppId;
import org.chromium.chrome.browser.KeyboardShortcuts;
import org.chromium.chrome.browser.WebContentsFactory;
import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate;
import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason;
import org.chromium.chrome.browser.compositor.layouts.LayoutManagerDocument;
import org.chromium.chrome.browser.datausage.DataUseTabUIManager;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
......@@ -500,7 +499,6 @@ public class CustomTabActivity extends ChromeActivity {
protected AppMenuPropertiesDelegate createAppMenuPropertiesDelegate() {
return new CustomTabAppMenuPropertiesDelegate(this, mIntentDataProvider.getMenuTitles(),
mIntentDataProvider.shouldShowShareMenuItem(),
mIntentDataProvider.shouldShowBookmarkMenuItem(),
mIntentDataProvider.isOpenedByChrome());
}
......@@ -636,9 +634,6 @@ public class CustomTabActivity extends ChromeActivity {
|| id == R.id.recent_tabs_menu_id || id == R.id.new_incognito_tab_menu_id
|| id == R.id.new_tab_menu_id || id == R.id.open_history_menu_id) {
return true;
} else if (id == R.id.bookmark_this_page_id
&& !mIntentDataProvider.shouldShowBookmarkMenuItem()) {
return true;
} else if (id == R.id.open_in_browser_id) {
openCurrentUrlInBrowser(false, true);
RecordUserAction.record("CustomTabsMenuOpenInChrome");
......@@ -647,17 +642,6 @@ public class CustomTabActivity extends ChromeActivity {
openCurrentUrlInBrowser(false, false);
RecordUserAction.record("CustomTabsMenuReadItLater");
return true;
} else if (id == R.id.find_in_page_id) {
mFindToolbarManager.showToolbar();
if (getContextualSearchManager() != null) {
getContextualSearchManager().hideContextualSearch(StateChangeReason.UNKNOWN);
}
if (fromMenu) {
RecordUserAction.record("MobileMenuFindInPage");
} else {
RecordUserAction.record("MobileShortcutFindInPage");
}
return true;
} else if (id == R.id.info_menu_id) {
if (getTabModelSelector().getCurrentTab() == null) return false;
WebsiteSettingsPopup.show(
......
......@@ -33,7 +33,6 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
private static final String SAMPLE_URL = "https://www.google.com";
private final boolean mShowShare;
private final boolean mShowBookmark;
private final List<String> mMenuEntries;
private final Map<MenuItem, Integer> mItemToIndexMap = new HashMap<MenuItem, Integer>();
private final AsyncTask<Void, Void, String> mDefaultBrowserFetcher;
......@@ -44,12 +43,10 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
* Creates an {@link CustomTabAppMenuPropertiesDelegate} instance.
*/
public CustomTabAppMenuPropertiesDelegate(final ChromeActivity activity,
List<String> menuEntries, boolean showShare, boolean showBookmark,
final boolean isOpenedByChrome) {
List<String> menuEntries, boolean showShare, final boolean isOpenedByChrome) {
super(activity);
mMenuEntries = menuEntries;
mShowShare = showShare;
mShowBookmark = showBookmark;
mDefaultBrowserFetcher = new AsyncTask<Void, Void, String>() {
@Override
......@@ -94,16 +91,6 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
mActivity, menu.findItem(R.id.direct_share_menu_id));
}
if (mShowBookmark) {
MenuItem bookmarkItem = menu.findItem(R.id.bookmark_this_page_id);
updateBookmarkMenuItem(bookmarkItem, currentTab);
} else {
// Because we have custom logic for laying out the icon row, the bookmark icon must
// be explicitly removed instead of just made invisible.
menu.findItem(R.id.icon_row_menu_id).getSubMenu().removeItem(
R.id.bookmark_this_page_id);
}
MenuItem openInChromeItem = menu.findItem(R.id.open_in_browser_id);
MenuItem readItLaterItem = menu.findItem(R.id.read_it_later_id);
if (ChromeFeatureList.isEnabled("ReadItLaterInMenu")) {
......
......@@ -56,12 +56,6 @@ public class CustomTabIntentDataProvider {
public static final String EXTRA_IS_OPENED_BY_CHROME =
"org.chromium.chrome.browser.customtabs.IS_OPENED_BY_CHROME";
/**
* Herb: Extra used by the main Chrome browser to enable the bookmark icon in the menu.
*/
public static final String EXTRA_SHOW_STAR_ICON =
"org.chromium.chrome.browser.customtabs.SHOW_STAR_ICON";
private static final int MAX_CUSTOM_MENU_ITEMS = 5;
private static final String ANIMATION_BUNDLE_PREFIX =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? "android:activity." : "android:";
......@@ -92,9 +86,6 @@ public class CustomTabIntentDataProvider {
/** Herb: Whether this CustomTabActivity was explicitly started by another Chrome Activity. */
private boolean mIsOpenedByChrome;
/** Herb: Whether or not the bookmark button should be shown. */
private boolean mShowBookmarkItem;
/**
* Constructs a {@link CustomTabIntentDataProvider}.
*/
......@@ -252,13 +243,6 @@ public class CustomTabIntentDataProvider {
return mShowShareItem;
}
/**
* @return Whether the bookmark item should be shown in the menu.
*/
public boolean shouldShowBookmarkMenuItem() {
return mShowBookmarkItem;
}
/**
* @return The params for the custom button that shows on the toolbar. If there is no applicable
* buttons, returns null.
......@@ -447,7 +431,5 @@ public class CustomTabIntentDataProvider {
mIsOpenedByChrome = IntentUtils.safeGetBooleanExtra(
intent, EXTRA_IS_OPENED_BY_CHROME, false);
mShowBookmarkItem = IntentUtils.safeGetBooleanExtra(
intent, EXTRA_SHOW_STAR_ICON, false);
}
}
......@@ -383,7 +383,6 @@ public class ChromeLauncherActivity extends Activity
newIntent.putExtra(CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM, true);
newIntent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME, true);
newIntent.putExtra(CustomTabIntentDataProvider.EXTRA_SHOW_STAR_ICON, true);
// Mark this as a trusted Chrome Intent.
IntentHandler.addTrustedIntentExtras(newIntent, context);
......
......@@ -110,7 +110,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
private static final String READ_IT_LATER_FEATURE = "ReadItLaterInMenu";
private static final int MAX_MENU_CUSTOM_ITEMS = 5;
private static final int NUM_CHROME_MENU_ITEMS = 3;
private static final int NUM_CHROME_MENU_ITEMS = 2;
private static final String
TEST_ACTION = "org.chromium.chrome.browser.customtabs.TEST_PENDING_INTENT_SENT";
private static final String TEST_PAGE = "/chrome/test/data/android/google.html";
......@@ -357,11 +357,11 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
assertNotNull(menu.findItem(R.id.forward_menu_id));
assertNotNull(menu.findItem(R.id.info_menu_id));
assertNotNull(menu.findItem(R.id.reload_menu_id));
assertNotNull(menu.findItem(R.id.find_in_page_id));
assertNotNull(menu.findItem(R.id.open_in_browser_id));
assertFalse(menu.findItem(R.id.share_row_menu_id).isVisible());
assertFalse(menu.findItem(R.id.share_row_menu_id).isEnabled());
assertNull(menu.findItem(R.id.bookmark_this_page_id));
assertNull(menu.findItem(R.id.find_in_page_id));
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment