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

Side by Side Diff: components/payments/payment_request_web_contents_manager.cc

Issue 2631133003: [Payments] Introduce basic interactive browsertests for Payment Request (Closed)
Patch Set: ObserverForTest 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 unified diff | Download patch
« no previous file with comments | « components/payments/payment_request_web_contents_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "components/payments/payment_request_web_contents_manager.h" 5 #include "components/payments/payment_request_web_contents_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "components/payments/payment_request_delegate.h" 11 #include "components/payments/payment_request_delegate.h"
12 12
13 DEFINE_WEB_CONTENTS_USER_DATA_KEY(payments::PaymentRequestWebContentsManager); 13 DEFINE_WEB_CONTENTS_USER_DATA_KEY(payments::PaymentRequestWebContentsManager);
14 14
15 namespace payments { 15 namespace payments {
16 16
17 PaymentRequestWebContentsManager::~PaymentRequestWebContentsManager() {} 17 PaymentRequestWebContentsManager::~PaymentRequestWebContentsManager() {}
18 18
19 PaymentRequestWebContentsManager* 19 PaymentRequestWebContentsManager*
20 PaymentRequestWebContentsManager::GetOrCreateForWebContents( 20 PaymentRequestWebContentsManager::GetOrCreateForWebContents(
21 content::WebContents* web_contents) { 21 content::WebContents* web_contents) {
22 DCHECK(web_contents); 22 DCHECK(web_contents);
23 // CreateForWebContents does nothing if the delegate instance already exists. 23 // CreateForWebContents does nothing if the manager instance already exists.
24 PaymentRequestWebContentsManager::CreateForWebContents(web_contents); 24 PaymentRequestWebContentsManager::CreateForWebContents(web_contents);
25 return PaymentRequestWebContentsManager::FromWebContents(web_contents); 25 return PaymentRequestWebContentsManager::FromWebContents(web_contents);
26 } 26 }
27 27
28 void PaymentRequestWebContentsManager::CreatePaymentRequest( 28 void PaymentRequestWebContentsManager::CreatePaymentRequest(
29 content::WebContents* web_contents, 29 content::WebContents* web_contents,
30 std::unique_ptr<PaymentRequestDelegate> delegate, 30 std::unique_ptr<PaymentRequestDelegate> delegate,
31 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request) { 31 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request) {
32 std::unique_ptr<PaymentRequest> new_request(new PaymentRequest( 32 std::unique_ptr<PaymentRequest> new_request(new PaymentRequest(
33 web_contents, std::move(delegate), this, std::move(request))); 33 web_contents, std::move(delegate), this, std::move(request)));
34 PaymentRequest* request_ptr = new_request.get(); 34 PaymentRequest* request_ptr = new_request.get();
35 payment_requests_.insert(std::make_pair(request_ptr, std::move(new_request))); 35 payment_requests_.insert(std::make_pair(request_ptr, std::move(new_request)));
36 } 36 }
37 37
38 void PaymentRequestWebContentsManager::DestroyRequest(PaymentRequest* request) { 38 void PaymentRequestWebContentsManager::DestroyRequest(PaymentRequest* request) {
39 payment_requests_.erase(request); 39 payment_requests_.erase(request);
40 } 40 }
41 41
42 PaymentRequestWebContentsManager::PaymentRequestWebContentsManager( 42 PaymentRequestWebContentsManager::PaymentRequestWebContentsManager(
43 content::WebContents* web_contents) {} 43 content::WebContents* web_contents) {}
44 44
45 } // namespace payments 45 } // namespace payments
OLDNEW
« no previous file with comments | « components/payments/payment_request_web_contents_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698