Commit 8f6a6e3b authored by Sebastien Lalancette's avatar Sebastien Lalancette Committed by Commit Bot

[iOS] Fix Articles Context Menu With Native CtxMenu Flag On

With the flag on, articles context menus weren't working. Moving the
flag check to the MostVisited flow instead of overall the long-press
gesture recognizer fixes it.

Bug: 1115970
Change-Id: Ic9945928c949cbef9ed874d5a381b071b18a54d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354272
Auto-Submit: Sebastien Lalancette <seblalancette@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797786}
parent 5223bf79
......@@ -254,14 +254,12 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
ApplyVisualConstraints(@[ @"V:|[collection]|", @"H:|[collection]|" ],
@{@"collection" : self.collectionView});
if (!IsNativeContextMenuEnabled()) {
UILongPressGestureRecognizer* longPressRecognizer =
[[UILongPressGestureRecognizer alloc]
initWithTarget:self
action:@selector(handleLongPress:)];
longPressRecognizer.delegate = self;
[self.collectionView addGestureRecognizer:longPressRecognizer];
}
self.overscrollActionsController = [[OverscrollActionsController alloc]
initWithScrollView:self.collectionView];
......@@ -830,10 +828,12 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
readLaterAction:NO];
break;
case ContentSuggestionTypeMostVisited:
[self.suggestionCommandHandler
displayContextMenuForMostVisitedItem:touchedItem
atPoint:touchLocation
atIndexPath:touchedItemIndexPath];
if (!IsNativeContextMenuEnabled()) {
[self.suggestionCommandHandler
displayContextMenuForMostVisitedItem:touchedItem
atPoint:touchLocation
atIndexPath:touchedItemIndexPath];
}
break;
default:
break;
......
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