forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayment_request_factory.cc
31 lines (25 loc) · 1.13 KB
/
payment_request_factory.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/payments/payment_request_factory.h"
#include <utility>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/payments/chrome_payment_request_delegate.h"
#include "components/payments/content/payment_request_web_contents_manager.h"
namespace payments {
void CreatePaymentRequest(const service_manager::BindSourceInfo& source_info,
mojom::PaymentRequestRequest request,
content::RenderFrameHost* render_frame_host) {
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
if (!web_contents)
return;
PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents)
->CreatePaymentRequest(
render_frame_host, web_contents,
base::MakeUnique<ChromePaymentRequestDelegate>(web_contents),
std::move(request),
/*observer_for_testing=*/nullptr);
}
} // namespace payments