Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2448)

Unified Diff: chrome/browser/payments/payment_request_factory.cc

Issue 2611253004: [Payment Request] Change the lifetime management of PaymentRequestImpl (Closed)
Patch Set: PaymentRequestImpl -> PaymentRequest Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/payments/payment_request_factory.h ('k') | chrome/browser/payments/payment_request_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..02e95455041a5c25af42b62743f2e9b647ebd8ec
--- /dev/null
+++ b/chrome/browser/payments/payment_request_factory.cc
@@ -0,0 +1,28 @@
+// 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 <memory>
+
+#include "base/logging.h"
+#include "base/memory/ptr_util.h"
+#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);
+ PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents)
+ ->CreatePaymentRequest(web_contents,
+ base::MakeUnique<ChromePaymentRequestDelegate>(),
+ std::move(request));
+}
+
+} // namespace payments
« no previous file with comments | « chrome/browser/payments/payment_request_factory.h ('k') | chrome/browser/payments/payment_request_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698