Commit d5c1ca86 authored by Maggie Cai's avatar Maggie Cai Committed by Commit Bot

Fix intent picker automatically dismiss issue.

Click to call dialogs needs to be closed if the tab navigates to a
different origin. In ChromeOS, click to call uses the same dialog as
intent picker. Intent picker dialog will show when tab navigates to a
different origin and there are Android apps that can handle this origin.

The click to call dialog closes cause the dialog to automatically closed
after briefly show up. This CL change the code to only close the dialog
for click to call. This CL also fix a issue the intent picker icon don't
show up for auto dialog pop up.

BUG=1045036

Bug: b/146227259
Change-Id: Iadb1db30c7e24108bee933eb93d57d73a206d3d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035821Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739217}
parent 08ec9eb5
......@@ -186,6 +186,8 @@ void AppsNavigationThrottle::ShowIntentPickerBubbleForApps(
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
if (!browser)
return;
IntentPickerTabHelper::SetShouldShowIcon(web_contents, true);
browser->window()->ShowIntentPickerBubble(
std::move(apps), show_stay_in_chrome, show_remember_selection,
PageActionIconType::kIntentPicker, base::nullopt, std::move(callback));
......
......@@ -299,7 +299,12 @@ IntentPickerBubbleView::IntentPickerBubbleView(
DialogDelegate::set_close_callback(base::Bind(
&IntentPickerBubbleView::OnDialogClosed, base::Unretained(this)));
set_close_on_main_frame_origin_navigation(true);
// Click to call bubbles need to be closed after navigation if the main frame
// origin changed. Other intent picker bubbles will be handled in
// AppsNavigationThrottle, they will get closed on each navigation start and
// should stay open until after navigation finishes.
set_close_on_main_frame_origin_navigation(icon_type ==
PageActionIconType::kClickToCall);
chrome::RecordDialogCreation(chrome::DialogIdentifier::INTENT_PICKER);
}
......
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