Skip to content

Commit

Permalink
[PaymentHandler] Don't close UI on iframe loading fails
Browse files Browse the repository at this point in the history
Context:
Having iframe navigating multiple times would make the payment handler
WebContents invokes the "didFailLoad" callback. Currently, didFailLoad
applies for both the mainframe and subframes. The UI shouldn't close
when the load failure happens on subframes.

Before:
The UI closes when the subframes fail to load.

After:
The UI doesn't close when the subframes fail to load.

Bug: 1137929

Change-Id: Iaba361e895d6bb4e46b0fb969a87958e9daebe57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2469536
Reviewed-by: Sahel Sharify <sahel@chromium.org>
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818316}
  • Loading branch information
maxlgu authored and Commit Bot committed Oct 18, 2020
1 parent 1801633 commit 569e668
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ private void closeUIForInsecureNavigation() {
// Implement WebContentsObserver:
@Override
public void didFailLoad(boolean isMainFrame, int errorCode, String failingUrl) {
if (!isMainFrame) return;
mHandler.post(() -> {
mCloseReason = CloseReason.FAIL_LOAD;
mHider.run();
Expand Down

0 comments on commit 569e668

Please sign in to comment.