Commit 1240aee0 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Do not pop out the intent picker if only desktop PWAs are in the app list.

Until the Chrome OS app registry is implemented, we cannot persist
"Remember my choice" for desktop PWAs in the intent picker.

On the advice of UI review, this CL suppresses popping out the intent
picker and instead shows the intent picker omnibox icon if only
desktop PWAs are available for the picker. This reduces user annoyance
until the persistence mechanism is available, at which point we will
pop out the picker for desktop PWAs again.

The picker will pop out if any ARC app is present in the list of apps.

BUG=824598

Change-Id: I027f231bae533f077a8a85acca41b64ae7a81444
Reviewed-on: https://chromium-review.googlesource.com/1068579
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarDavid Jacobo <djacobo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560970}
parent d0fe7670
......@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/apps/intent_helper/apps_navigation_throttle.h"
#include <algorithm>
#include <utility>
#include "base/bind.h"
......@@ -442,7 +443,22 @@ void AppsNavigationThrottle::OnDeferredNavigationProcessed(
if (apps_for_picker.empty())
ui_displayed_ = false;
ShowIntentPickerBubbleForApps(web_contents, url, std::move(apps_for_picker));
// If we only have PWAs in the app list, do not show the intent picker.
// Instead just show the omnibox icon. This is to reduce annoyance to users
// until "Remember my choice" is available for desktop PWAs.
// TODO(crbug.com/826982): show the intent picker when the app registry is
// available to persist "Remember my choice" for PWAs.
if (std::all_of(apps_for_picker.begin(), apps_for_picker.end(),
[](const IntentPickerAppInfo& app_info) {
return app_info.type == AppType::PWA;
})) {
ui_displayed_ = false;
chrome::SetIntentPickerViewVisibility(
chrome::FindBrowserWithWebContents(web_contents), /*visible=*/true);
} else {
ShowIntentPickerBubbleForApps(web_contents, url,
std::move(apps_for_picker));
}
// We are about to resume the navigation, which may destroy this object.
Resume();
......
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