Skip to content

Commit

Permalink
[iOS] Remove Popup Menu IPH delay to prevent DCHECK
Browse files Browse the repository at this point in the history
My guess as to the root cause is that the situation changed between
checking if the presenter can present the bubble initially and then
after the delay when presentation actually takes place. I can't remember
exactly why I added this delay in the first place and the bubble still
presents fine without it, so I don't think it's necessary.

This also adds a missing return after checking if the feature
engagement tracker is initialized.

Bug: 1420460
Change-Id: Ie5e481037d041b115a0c2d8d22f3af7b7b3e1f13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4306868
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1114786}
  • Loading branch information
rkgibson2 authored and Chromium LUCI CQ committed Mar 8, 2023
1 parent ca6526b commit b1d8d36
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions ios/chrome/browser/ui/popup_menu/popup_menu_help_coordinator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
#error "This file requires ARC support."
#endif

namespace {
// Delay between the time the app launches, and the time the
// menu button tip is shown.
constexpr base::TimeDelta kMenuTipDelay = base::Seconds(1);
} // namespace

@interface PopupMenuHelpCoordinator () <SceneStateObserver>

// Bubble view controller presenter for popup menu tip.
Expand Down Expand Up @@ -181,6 +175,7 @@ - (void)showPopupMenuBubbleIfNecessary {
}
[weakSelf showPopupMenuBubbleIfNecessary];
}));
return;
}

// Skip if a presentation is already in progress
Expand Down Expand Up @@ -214,22 +209,12 @@ - (void)showPopupMenuBubbleIfNecessary {

// Present the bubble after the delay.
self.popupMenuBubblePresenter = bubblePresenter;
__weak __typeof(self) weakSelf = self;
base::SequencedTaskRunner::GetCurrentDefault()->PostDelayedTask(
FROM_HERE, base::BindOnce(^{
[weakSelf presentPopupMenuBubbleAtAnchorPoint:anchorPoint];
[weakSelf.UIUpdater updateUIForIPHDisplayed:PopupMenuTypeToolsMenu];
}),
kMenuTipDelay);
}

// Actually presents the bubble.
- (void)presentPopupMenuBubbleAtAnchorPoint:(CGPoint)anchorPoint {
self.inSessionWithPopupMenuIPH = YES;
[self.popupMenuBubblePresenter
presentInViewController:self.baseViewController
view:self.baseViewController.view
anchorPoint:anchorPoint];
[self.UIUpdater updateUIForIPHDisplayed:PopupMenuTypeToolsMenu];
}

#pragma mark - Overflow Menu Bubble methods
Expand Down

0 comments on commit b1d8d36

Please sign in to comment.