Commit 45993fbf authored by Maggie Cai's avatar Maggie Cai Committed by Commit Bot

[IntentHandling] Increment auto display service counter when dialog

deactivated.

This CL increments the auto display service counter when dialog
deactivated on CommonAppsNavigationThrottle. The dialog should stop auto
pop up after 2+ dismissals.

BUG=853604

Change-Id: I3ec88d4d767dbf41c08258f1b055fc6467736a56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424363Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809612}
parent b4dfd1db
......@@ -117,6 +117,15 @@ void CommonAppsNavigationThrottle::OnIntentPickerClosed(
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile);
// If the picker was closed without an app being chosen,
// e.g. due to the tab being closed. Keep count of this scenario so we can
// stop the UI from showing after 2+ dismissals.
if (entry_type == PickerEntryType::kUnknown &&
close_reason == IntentPickerCloseReason::DIALOG_DEACTIVATED) {
if (ui_auto_display_service)
ui_auto_display_service->IncrementCounter(url);
}
if (should_persist) {
// TODO(https://crbug.com/853604): Remove this and convert to a DCHECK
// after finding out the root cause.
......
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