Chromium Code Reviews| Index: chrome/browser/payments/payment_request_factory.cc |
| diff --git a/chrome/browser/payments/payment_request_factory.cc b/chrome/browser/payments/payment_request_factory.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5a111f20ab4546b53c27b8501df23e06ea6a59bd |
| --- /dev/null |
| +++ b/chrome/browser/payments/payment_request_factory.cc |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
please use gerrit instead
2017/01/06 21:49:09
2017
Mathieu
2017/01/07 05:03:07
Done.
|
| +// 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 <memory> |
| + |
| +#include "chrome/browser/payments/chrome_payment_request_delegate.h" |
| +#include "components/payments/payment_request_delegate.h" |
| +#include "components/payments/payment_request_web_contents_manager.h" |
| +#include "content/public/browser/web_contents.h" |
| + |
| +namespace payments { |
| + |
| +void CreatePaymentRequestForWebContents( |
| + content::WebContents* web_contents, |
| + mojo::InterfaceRequest<payments::mojom::PaymentRequest> request) { |
| + DCHECK(web_contents); |
|
please use gerrit instead
2017/01/06 21:49:09
#include "base/logging.h"
Mathieu
2017/01/07 05:03:07
Done.
|
| + PaymentRequestWebContentsManager* web_contents_manager = |
| + PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents); |
| + |
| + std::unique_ptr<PaymentRequestDelegate> delegate( |
| + new ChromePaymentRequestDelegate()); |
| + web_contents_manager->CreatePaymentRequestImpl( |
| + web_contents, std::move(delegate), std::move(request)); |
|
please use gerrit instead
2017/01/06 21:49:09
Would a single statement be easier to understand?
Mathieu
2017/01/07 05:03:07
Done. good suggestion!
|
| +} |
| + |
| +} // namespace payments |