Commit 64733616 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Remove Close All Incognito Tab from TabGrid popup

This CL removes the Close All Incognito Tabs action from the TabGrid
popup menu in incognito, making it the same as the non-incognito.

Bug: 846614
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ib19301aa9582c7bb2eb94512c50082c40c6dc510
Reviewed-on: https://chromium-review.googlesource.com/1073150Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561851}
parent ad0e8656
...@@ -30,7 +30,6 @@ typedef NS_ENUM(NSInteger, PopupMenuAction) { ...@@ -30,7 +30,6 @@ typedef NS_ENUM(NSInteger, PopupMenuAction) {
PopupMenuActionHistory, PopupMenuActionHistory,
PopupMenuActionSettings, PopupMenuActionSettings,
PopupMenuActionCloseTab, PopupMenuActionCloseTab,
PopupMenuActionCloseAllIncognitoTabs,
PopupMenuActionNavigate, PopupMenuActionNavigate,
PopupMenuActionPasteAndGo, PopupMenuActionPasteAndGo,
PopupMenuActionVoiceSearch, PopupMenuActionVoiceSearch,
......
...@@ -561,23 +561,11 @@ PopupMenuToolsItem* CreateTableViewItem(int titleID, ...@@ -561,23 +561,11 @@ PopupMenuToolsItem* CreateTableViewItem(int titleID,
// Creates the menu items for the tab grid menu. // Creates the menu items for the tab grid menu.
- (void)createTabGridMenuItems { - (void)createTabGridMenuItems {
NSMutableArray* closeItems = [NSMutableArray array];
if (self.isIncognito) {
PopupMenuToolsItem* closeAllIncognitoTabs = CreateTableViewItem(
IDS_IOS_TOOLS_MENU_CLOSE_ALL_INCOGNITO_TABS,
PopupMenuActionCloseAllIncognitoTabs, @"popup_menu_new_incognito_tab",
kToolsMenuCloseAllIncognitoTabsId);
closeAllIncognitoTabs.destructiveAction = YES;
[closeItems addObject:closeAllIncognitoTabs];
}
PopupMenuToolsItem* closeTab = PopupMenuToolsItem* closeTab =
CreateTableViewItem(IDS_IOS_TOOLS_MENU_CLOSE_TAB, PopupMenuActionCloseTab, CreateTableViewItem(IDS_IOS_TOOLS_MENU_CLOSE_TAB, PopupMenuActionCloseTab,
@"popup_menu_close_tab", kToolsMenuCloseTabId); @"popup_menu_close_tab", kToolsMenuCloseTabId);
closeTab.destructiveAction = YES; closeTab.destructiveAction = YES;
[closeItems addObject:closeTab]; self.items = @[ [self itemsForNewTab], @[ closeTab ] ];
self.items = @[ [self itemsForNewTab], closeItems ];
} }
// Creates the menu items for the search menu. // Creates the menu items for the search menu.
......
...@@ -173,7 +173,7 @@ TEST_F(PopupMenuMediatorTest, TestElementsTabGridNonIncognito) { ...@@ -173,7 +173,7 @@ TEST_F(PopupMenuMediatorTest, TestElementsTabGridNonIncognito) {
// for the Tab Grid type, in incognito. // for the Tab Grid type, in incognito.
TEST_F(PopupMenuMediatorTest, TestElementsTabGridIncognito) { TEST_F(PopupMenuMediatorTest, TestElementsTabGridIncognito) {
CreateMediator(PopupMenuTypeTabGrid, YES, NO); CreateMediator(PopupMenuTypeTabGrid, YES, NO);
CheckMediatorSetItems(@[ @(2), @(2) ]); CheckMediatorSetItems(@[ @(2), @(1) ]);
} }
// Tests that the mediator is asking for an item to be highlighted when asked. // Tests that the mediator is asking for an item to be highlighted when asked.
......
...@@ -276,10 +276,6 @@ const CGFloat kScrollIndicatorVerticalInsets = 11; ...@@ -276,10 +276,6 @@ const CGFloat kScrollIndicatorVerticalInsets = 11;
base::RecordAction(UserMetricsAction("MobileMenuCloseTab")); base::RecordAction(UserMetricsAction("MobileMenuCloseTab"));
[self.dispatcher closeCurrentTab]; [self.dispatcher closeCurrentTab];
break; break;
case PopupMenuActionCloseAllIncognitoTabs:
base::RecordAction(UserMetricsAction("MobileMenuCloseAllIncognitoTabs"));
[self.dispatcher closeAllIncognitoTabs];
break;
case PopupMenuActionNavigate: case PopupMenuActionNavigate:
// No metrics for this item. // No metrics for this item.
[self.commandHandler navigateToPageForItem:item]; [self.commandHandler navigateToPageForItem:item];
......
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