Commit 9dc41ea4 authored by Sebastien Lalancette's avatar Sebastien Lalancette Committed by Commit Bot

[iOS] Disable Context Menus when in Edit Mode

Fixes the bad behavior in three components:
- History
- Reading List
- Bookmarks

Bug: 1093302
Change-Id: Ia81bfd270e898c3061eb7ad061cc5aea338dc947
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2349270Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Sebastien Lalancette <seblalancette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796964}
parent 12a1ad20
...@@ -2171,6 +2171,11 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) { ...@@ -2171,6 +2171,11 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
return nil; return nil;
} }
if (self.sharedState.currentlyInEditMode) {
// Don't show the context menu when currently in editing mode.
return nil;
}
if (![self canShowContextMenuFor:indexPath]) { if (![self canShowContextMenuFor:indexPath]) {
return nil; return nil;
} }
......
...@@ -625,6 +625,11 @@ const CGFloat kButtonHorizontalPadding = 30.0; ...@@ -625,6 +625,11 @@ const CGFloat kButtonHorizontalPadding = 30.0;
return nil; return nil;
} }
if (self.isEditing) {
// Don't show the context menu when currently in editing mode.
return nil;
}
HistoryEntryItem* entry = base::mac::ObjCCastStrict<HistoryEntryItem>( HistoryEntryItem* entry = base::mac::ObjCCastStrict<HistoryEntryItem>(
[self.tableViewModel itemAtIndexPath:indexPath]); [self.tableViewModel itemAtIndexPath:indexPath]);
UIView* cell = [self.tableView cellForRowAtIndexPath:indexPath]; UIView* cell = [self.tableView cellForRowAtIndexPath:indexPath];
......
...@@ -316,6 +316,11 @@ ReadingListSelectionState GetSelectionStateForSelectedCounts( ...@@ -316,6 +316,11 @@ ReadingListSelectionState GetSelectionStateForSelectedCounts(
return nil; return nil;
} }
if (self.isEditing) {
// Don't show the context menu when currently in editing mode.
return nil;
}
return [self.menuProvider return [self.menuProvider
contextMenuConfigurationForItem:[self.tableViewModel contextMenuConfigurationForItem:[self.tableViewModel
itemAtIndexPath:indexPath] itemAtIndexPath:indexPath]
......
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