Commit ecdc2fa4 authored by Phillis Tang's avatar Phillis Tang Committed by Chromium LUCI CQ

DPWA: highlight install icon when In-Product Help is shown

PWA install icon should be highlighted when its In-Product Help promo
is shown, and be de-highlighted when the promo disappears.

Bug: 1163235
Change-Id: I29cc0269e4f98f401ad69d1a4e6d620bdbd268be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2610938
Commit-Queue: Phillis Tang <phillis@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840436}
parent ec4ac041
...@@ -96,13 +96,15 @@ void PwaInstallView::UpdateImpl() { ...@@ -96,13 +96,15 @@ void PwaInstallView::UpdateImpl() {
if (controller) { if (controller) {
// Reset the iph flag when it's shown again. // Reset the iph flag when it's shown again.
install_icon_clicked_after_iph_shown_ = false; install_icon_clicked_after_iph_shown_ = false;
controller->MaybeShowPromoWithTextReplacements( bool iph_shown = controller->MaybeShowPromoWithTextReplacements(
feature_engagement::kIPHDesktopPwaInstallFeature, feature_engagement::kIPHDesktopPwaInstallFeature,
FeaturePromoTextReplacements::WithString( FeaturePromoTextReplacements::WithString(
webapps::AppBannerManager::GetInstallableWebAppName( webapps::AppBannerManager::GetInstallableWebAppName(
web_contents)), web_contents)),
base::BindOnce(&PwaInstallView::OnIphClosed, base::BindOnce(&PwaInstallView::OnIphClosed,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
if (iph_shown)
SetHighlighted(true);
} }
} }
SetVisible(is_probably_promotable || PWAConfirmationBubbleView::IsShowing()); SetVisible(is_probably_promotable || PWAConfirmationBubbleView::IsShowing());
...@@ -110,11 +112,12 @@ void PwaInstallView::UpdateImpl() { ...@@ -110,11 +112,12 @@ void PwaInstallView::UpdateImpl() {
void PwaInstallView::OnIphClosed() { void PwaInstallView::OnIphClosed() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// IPH is also closed when the install button is clicked. This does not // IPH is also closed when the install button is clicked. This does not
// count as an 'ignore'. // count as an 'ignore'. The button should remain highlighted and will
// eventually be un-highlighted when PWAConfirmationBubbleView is closed.
if (install_icon_clicked_after_iph_shown_) if (install_icon_clicked_after_iph_shown_)
return; return;
SetHighlighted(false);
content::WebContents* web_contents = GetWebContents(); content::WebContents* web_contents = GetWebContents();
if (!web_contents) if (!web_contents)
return; return;
......
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