Commit bc72042c authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

Add PaymentProviderApp::setOpenedWindow for desktop

Context:
On desktop & Android, when payment handler is opened,
PaymentProviderApp::setOpenedWindow() must be called to notify of the
payment handler's WebContents. Now that desktop doesn't call
setOpenedWindow, this CL is to add this missing part.

Change:
* Call payment request web-contents'
PaymentProviderApp::setOpenedWindow() when the payment handler window
has just opened.

Bug: 1131874

Change-Id: Ibd8405ff3dec6ec02f5ba0e0cb4fc0433667c21c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2436310
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812037}
parent c08c6a23
......@@ -6,6 +6,7 @@
#include <memory>
#include "base/check_op.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/payments/ssl_validity_checker.h"
......@@ -237,6 +238,11 @@ void PaymentHandlerWebFlowViewController::FillContentView(
content_view->AddChildView(std::make_unique<views::WebView>(profile_));
Observe(web_view->GetWebContents());
web_contents()->SetDelegate(this);
DCHECK_NE(log_.web_contents(), web_contents());
content::PaymentAppProvider::GetOrCreateForWebContents(
/*payment_request_web_contents=*/log_.web_contents())
->SetOpenedWindow(
/*payment_handler_web_contents=*/web_contents());
web_view->LoadInitialURL(target_);
// Enable modal dialogs for web-based payment handlers.
......
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