Commit 010330e0 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Deduplicate the "Delete" AccessibilityAction of ReadingList

The ReadingList cells used to have two "Delete" custom accessibility
actions: one from UIKit because it is possible to swipe-to-delete, the
other from the custome action set on the cell directly.
This CL removes the one set from the code, leaving only the UIKit one.

Bug: 985746
Change-Id: I873703cd65d09dfe8e2779ed4760f81c22812ba1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715346
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680026}
parent ae0450f7
......@@ -14,7 +14,6 @@
// Returns whether the entry is read.
- (BOOL)isItemRead:(id<ReadingListListItem>)item;
- (void)deleteItem:(id<ReadingListListItem>)item;
- (void)openItemInNewTab:(id<ReadingListListItem>)item;
- (void)openItemInNewIncognitoTab:(id<ReadingListListItem>)item;
- (void)openItemOffline:(id<ReadingListListItem>)item;
......
......@@ -55,11 +55,6 @@
- (NSArray<UIAccessibilityCustomAction*>*)customActionsForItem:
(id<ReadingListListItem>)item {
ReadingListCustomAction* deleteAction = [[ReadingListCustomAction alloc]
initWithName:l10n_util::GetNSString(IDS_IOS_READING_LIST_DELETE_BUTTON)
target:self
selector:@selector(deleteItem:)
item:item];
ReadingListCustomAction* toggleReadStatus = nil;
if ([self.accessibilityDelegate isItemRead:item]) {
toggleReadStatus = [[ReadingListCustomAction alloc]
......@@ -97,7 +92,7 @@
item:item];
NSMutableArray* customActions = [NSMutableArray
arrayWithObjects:deleteAction, toggleReadStatus, openInNewTabAction,
arrayWithObjects:toggleReadStatus, openInNewTabAction,
openInNewIncognitoTabAction, copyURLAction, nil];
if (item.distillationState == ReadingListUIDistillationStatusSuccess) {
......@@ -117,11 +112,6 @@
return customActions;
}
- (BOOL)deleteItem:(ReadingListCustomAction*)action {
[self.accessibilityDelegate deleteItem:action.item];
return YES;
}
- (BOOL)markRead:(ReadingListCustomAction*)action {
[self.accessibilityDelegate markItemRead:action.item];
return YES;
......
......@@ -359,13 +359,6 @@ ReadingListSelectionState GetSelectionStateForSelectedCounts(
return [self.dataSource isItemRead:item];
}
- (void)deleteItem:(id<ReadingListListItem>)item {
TableViewModel* model = self.tableViewModel;
TableViewItem* tableViewItem = base::mac::ObjCCastStrict<TableViewItem>(item);
if ([model hasItem:tableViewItem])
[self deleteItemsAtIndexPaths:@[ [model indexPathForItem:tableViewItem] ]];
}
- (void)openItemInNewTab:(id<ReadingListListItem>)item {
[self.delegate readingListListViewController:self
openItemInNewTab: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