| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/payments/payment_request_factory.h" | 5 #include "chrome/browser/payments/payment_request_factory.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "chrome/browser/payments/chrome_payment_request_delegate.h" | 11 #include "chrome/browser/payments/chrome_payment_request_delegate.h" |
| 12 #include "components/payments/content/payment_request_web_contents_manager.h" | 12 #include "components/payments/content/payment_request_web_contents_manager.h" |
| 13 #include "components/payments/core/payment_request_delegate.h" | |
| 14 #include "content/public/browser/web_contents.h" | |
| 15 | 13 |
| 16 namespace payments { | 14 namespace payments { |
| 17 | 15 |
| 18 void CreatePaymentRequestForWebContents( | 16 void CreatePaymentRequest(content::RenderFrameHost* render_frame_host, |
| 19 content::WebContents* web_contents, | 17 content::WebContents* web_contents, |
| 20 const service_manager::BindSourceInfo& source_info, | 18 const service_manager::BindSourceInfo& source_info, |
| 21 payments::mojom::PaymentRequestRequest request) { | 19 mojom::PaymentRequestRequest request) { |
| 22 DCHECK(web_contents); | 20 DCHECK(web_contents); |
| 23 PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents) | 21 PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents) |
| 24 ->CreatePaymentRequest( | 22 ->CreatePaymentRequest( |
| 25 web_contents, | 23 render_frame_host, web_contents, |
| 26 base::MakeUnique<ChromePaymentRequestDelegate>(web_contents), | 24 base::MakeUnique<ChromePaymentRequestDelegate>(web_contents), |
| 27 std::move(request), | 25 std::move(request), |
| 28 /*observer_for_testing=*/nullptr); | 26 /*observer_for_testing=*/nullptr); |
| 29 } | 27 } |
| 30 | 28 |
| 31 } // namespace payments | 29 } // namespace payments |
| OLD | NEW |