Commit f4739065 authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Remove DCHECK in ReopenTabPromoController::OnTabReopened()

This function gets called whenever a tab is reopened from the main
menu, even if IPH isn't showing. As a result, DCHECKing which promo
step we are on fails. To remove the DCHECK, a separate flag is used to
track whether IPH is showing. This flag is queried to check whether to
update the current step.

Bug: 933329
Change-Id: I1cad6305cc95a3170ec784015e85c0a067d6522c
Reviewed-on: https://chromium-review.googlesource.com/c/1478188Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633840}
parent 1d89521e
......@@ -34,7 +34,8 @@ ReopenTabPromoController::ReopenTabPromoController(BrowserView* browser_view)
void ReopenTabPromoController::ShowPromo() {
// This shouldn't be called more than once. Check that state is fresh.
DCHECK_EQ(StepAtDismissal::kBubbleShown, promo_step_);
DCHECK(!is_showing_);
is_showing_ = true;
// Here, we start the promo display. We highlight the app menu button and open
// the promo bubble.
......@@ -52,8 +53,7 @@ void ReopenTabPromoController::ShowPromo() {
void ReopenTabPromoController::OnTabReopened(int command_id) {
iph_service_->TabReopened();
if (command_id == AppMenuModel::kMinRecentTabsCommandId) {
DCHECK_EQ(StepAtDismissal::kMenuOpened, promo_step_);
if (is_showing_ && command_id == AppMenuModel::kMinRecentTabsCommandId) {
promo_step_ = StepAtDismissal::kTabReopened;
}
}
......
......@@ -67,6 +67,9 @@ class ReopenTabPromoController : public AppMenuButtonObserver,
// flow ends.
StepAtDismissal promo_step_ = StepAtDismissal::kBubbleShown;
// Whether we are showing the promo.
bool is_showing_ = false;
DISALLOW_COPY_AND_ASSIGN(ReopenTabPromoController);
};
......
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