[PaymentHandler] Hide Payment Request UI when Payment Handler UI open
In the new bottom-sheet based Payment Handler UI, the Payment Request UI is currently obstructing the PH UI. This is because PR UI is a Dialog, and the PH UI is a widget on the ChromeActivity - Dialogs displayed on the top graphic layer of their activity. To solve this issue, this CL change to hide the PR UI when opens a PH UI, and reshow the PR UI when hides the PH UI. The way to implement this behavior is to create a coordinator responsible for coordinating the display of both UIs, so that: * at most one of PH UI, PR UI is displayed at any moment * PH UI is prioritized over PR UI * the coordinating mechanism is robust to the external factors, e.g, a timeout event tries to show the PR UI when it's not supposed to be shown. As a side issue this CL solves, clicking the PR UI's "Pay" after hiding the PH UI used to fail. This was because the PH UI reference wasn't cleaned up when hiding. This CL adds a cleanup callback on PH UI closed to solve the issue. Bug: 999196 Change-Id: Ic602378cc30e93d1ba318a55006100feab7eac50 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1924600Reviewed-by:Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#719994}
Showing
Please register or sign in to comment