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 = ...@@ -254,14 +254,12 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
ApplyVisualConstraints(@[ @"V:|[collection]|", @"H:|[collection]|" ], ApplyVisualConstraints(@[ @"V:|[collection]|", @"H:|[collection]|" ],
@{@"collection" : self.collectionView}); @{@"collection" : self.collectionView});
if (!IsNativeContextMenuEnabled()) {
UILongPressGestureRecognizer* longPressRecognizer = UILongPressGestureRecognizer* longPressRecognizer =
[[UILongPressGestureRecognizer alloc] [[UILongPressGestureRecognizer alloc]
initWithTarget:self initWithTarget:self
action:@selector(handleLongPress:)]; action:@selector(handleLongPress:)];
longPressRecognizer.delegate = self; longPressRecognizer.delegate = self;
[self.collectionView addGestureRecognizer:longPressRecognizer]; [self.collectionView addGestureRecognizer:longPressRecognizer];
}
self.overscrollActionsController = [[OverscrollActionsController alloc] self.overscrollActionsController = [[OverscrollActionsController alloc]
initWithScrollView:self.collectionView]; initWithScrollView:self.collectionView];
...@@ -830,10 +828,12 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix = ...@@ -830,10 +828,12 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
readLaterAction:NO]; readLaterAction:NO];
break; break;
case ContentSuggestionTypeMostVisited: case ContentSuggestionTypeMostVisited:
[self.suggestionCommandHandler if (!IsNativeContextMenuEnabled()) {
displayContextMenuForMostVisitedItem:touchedItem [self.suggestionCommandHandler
atPoint:touchLocation displayContextMenuForMostVisitedItem:touchedItem
atIndexPath:touchedItemIndexPath]; atPoint:touchLocation
atIndexPath:touchedItemIndexPath];
}
break; break;
default: default:
break; 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