| Index: ios/chrome/browser/ui/bookmarks/bookmark_menu_view.mm
|
| diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_menu_view.mm b/ios/chrome/browser/ui/bookmarks/bookmark_menu_view.mm
|
| index 680ec47291b6d8279f86e3431da38409916e5fc0..bee854aeec5f5c32898e07f220afba19e70e08e4 100644
|
| --- a/ios/chrome/browser/ui/bookmarks/bookmark_menu_view.mm
|
| +++ b/ios/chrome/browser/ui/bookmarks/bookmark_menu_view.mm
|
| @@ -137,12 +137,18 @@
|
| [[NSMutableArray alloc] init]);
|
| [self.menuItems addObject:topSection];
|
|
|
| - // Mobile bookmark is shown even if empty.
|
| - [topSection
|
| - addObject:[BookmarkMenuItem folderMenuItemForNode:mobileBookmarks
|
| - rootAncestor:mobileBookmarks]];
|
| - // Bookmarks Bar and Other Bookmarks are special folders and are shown at the
|
| - // top if they contain anything.
|
| + if (experimental_flags::IsAllBookmarksEnabled()) {
|
| + // All Items is always visible.
|
| + [topSection addObject:[BookmarkMenuItem allMenuItem]];
|
| + }
|
| + // Bookmarks Bar, Mobile Bookmarks and Other Bookmarks are special folders and
|
| + // are shown at the top if they contain anything.
|
| + if (!mobileBookmarks->empty() ||
|
| + !experimental_flags::IsAllBookmarksEnabled()) {
|
| + [topSection
|
| + addObject:[BookmarkMenuItem folderMenuItemForNode:mobileBookmarks
|
| + rootAncestor:mobileBookmarks]];
|
| + }
|
| if (!bookmarkBar->empty()) {
|
| [topSection addObject:[BookmarkMenuItem folderMenuItemForNode:bookmarkBar
|
| rootAncestor:bookmarkBar]];
|
| @@ -262,6 +268,15 @@
|
| return;
|
| }
|
|
|
| + if (node == self.primaryMenuItem.rootAncestor) {
|
| + // The deleted node is the root node of the current selected folder. Move to
|
| + // all items.
|
| + self.primaryMenuItem = [BookmarkMenuItem allMenuItem];
|
| + [self.delegate bookmarkMenuView:self selectedMenuItem:self.primaryMenuItem];
|
| + [self reloadData];
|
| + return;
|
| + }
|
| +
|
| const BookmarkNode* root =
|
| RootLevelFolderForNode(parentFolder, self.bookmarkModel);
|
|
|
| @@ -385,7 +400,8 @@
|
| shouldProcessInkTouchesAtTouchLocation:(CGPoint)location {
|
| NSIndexPath* indexPath = [self.tableView indexPathForRowAtPoint:location];
|
| BookmarkMenuItem* menuItem = [self menuItemAtIndexPath:indexPath];
|
| - return menuItem.type == bookmarks::MenuItemFolder;
|
| + return menuItem.type == bookmarks::MenuItemAll ||
|
| + menuItem.type == bookmarks::MenuItemFolder;
|
| }
|
|
|
| - (MDCInkView*)inkTouchController:(MDCInkTouchController*)inkTouchController
|
|
|