Commit 2f2a2a62 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Mark Translate Infobar to skip banner if translating

This will allow the Overlay framework to not create an overlay request
when a user navigates to a page that is marked as auto-translate. This
is necessary because the initial translate step is TRANSLATING and
the Overlay framework responds to Infobar additions by presenting
a Banner, which should not happen if the BEFORE_TRANSLTE step is skipped.

Bug: 1071914
Change-Id: Ie174702b4e12f91da75d71fbb15850053a97e7ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2154396
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760304}
parent f9cffdaf
......@@ -97,7 +97,10 @@ std::unique_ptr<infobars::InfoBar> ChromeIOSTranslateClient::CreateInfoBar(
TranslateInfobarCoordinator* coordinator =
[[TranslateInfobarCoordinator alloc]
initWithInfoBarDelegate:delegate.get()];
return std::make_unique<InfoBarIOS>(coordinator, std::move(delegate));
bool skip_banner = delegate->translate_step() ==
translate::TranslateStep::TRANSLATE_STEP_TRANSLATING;
return std::make_unique<InfoBarIOS>(coordinator, std::move(delegate),
skip_banner);
} else {
TranslateInfoBarController* controller = [[TranslateInfoBarController alloc]
initWithInfoBarDelegate:delegate.get()];
......
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