This is the cherry pick merge for the M73 branch which was approved here:

[Autofill Assistant] Prompt only shows button if element exists

Before this patch, buttons were always displayed on prompt. That was
incomplete: it did not allow reproducing the behavior we currently have
between scripts where button appear as a result of DOM changes.

With this patch, prompt button reproduce the between-script behavior,
allowing buttons to be shown only conditionally.

Bug: 122825639
Change-Id: I53eee48156cac1f2e5f1b81dd86a48bb25566a0c
Commit-Queue: Stephane Zermatten <>
Reviewed-by: Mathias Carlen <>
Cr-Original-Commit-Position: refs/heads/master@{#626943}(cherry picked from commit 97ac6fc29d0d6832c7329cdb103dfd74f4aee861)
Reviewed-by: Stephane Zermatten <>
Cr-Commit-Position: refs/branch-heads/3683@{#109}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
3 files changed