Commit 6a3f7b33 authored by Jun Cai's avatar Jun Cai Committed by Commit Bot

[sms] Replace current infobar if one exists

This CL replaces the current infobars if there are existing ones by
removing them.

Bug: 999222
Change-Id: Id3d84ca24a935c6c3420dfeb8194d0610278a631
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1775213
Commit-Queue: Jun Cai <juncai@chromium.org>
Reviewed-by: default avatarAyu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692123}
parent 7527399e
...@@ -27,7 +27,8 @@ void SmsInfoBar::Create(content::WebContents* web_contents, ...@@ -27,7 +27,8 @@ void SmsInfoBar::Create(content::WebContents* web_contents,
auto infobar = auto infobar =
std::make_unique<SmsInfoBar>(web_contents, std::move(delegate)); std::make_unique<SmsInfoBar>(web_contents, std::move(delegate));
auto* infobar_service = InfoBarService::FromWebContents(web_contents); auto* infobar_service = InfoBarService::FromWebContents(web_contents);
infobar_service->AddInfoBar(std::move(infobar)); infobar_service->RemoveAllInfoBars(/*animate=*/false);
infobar_service->AddInfoBar(std::move(infobar), /*replace_existing=*/true);
} }
SmsInfoBar::SmsInfoBar(content::WebContents* web_contents, SmsInfoBar::SmsInfoBar(content::WebContents* web_contents,
......
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