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

Side by Side Diff: components/payments/content/payment_request.cc

Issue 2779283002: [Web Payments] Implement the CVC Unmask dialog. (Closed)
Patch Set: Update AutofillPaymentInstrument's credit_card_ after unmasking. Created 3 years, 8 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
OLDNEW
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 "components/payments/content/payment_request.h" 5 #include "components/payments/content/payment_request.h"
6 6
7 #include <string>
7 #include <utility> 8 #include <utility>
8 9
9 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
10 #include "components/payments/content/payment_details_validation.h" 11 #include "components/payments/content/payment_details_validation.h"
11 #include "components/payments/content/payment_request_web_contents_manager.h" 12 #include "components/payments/content/payment_request_web_contents_manager.h"
12 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
13 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
14 15
15 namespace payments { 16 namespace payments {
16 17
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 106
106 void PaymentRequest::OnInvalidSpecProvided() { 107 void PaymentRequest::OnInvalidSpecProvided() {
107 OnConnectionTerminated(); 108 OnConnectionTerminated();
108 } 109 }
109 110
110 void PaymentRequest::OnPaymentResponseAvailable( 111 void PaymentRequest::OnPaymentResponseAvailable(
111 mojom::PaymentResponsePtr response) { 112 mojom::PaymentResponsePtr response) {
112 client_->OnPaymentResponse(std::move(response)); 113 client_->OnPaymentResponse(std::move(response));
113 } 114 }
114 115
116 PaymentRequestDelegate* PaymentRequest::GetPaymentRequestDelegate() {
117 return delegate_.get();
118 }
119
115 void PaymentRequest::UserCancelled() { 120 void PaymentRequest::UserCancelled() {
116 // If |client_| is not bound, then the object is already being destroyed as 121 // If |client_| is not bound, then the object is already being destroyed as
117 // a result of a renderer event. 122 // a result of a renderer event.
118 if (!client_.is_bound()) 123 if (!client_.is_bound())
119 return; 124 return;
120 125
121 // This sends an error to the renderer, which informs the API user. 126 // This sends an error to the renderer, which informs the API user.
122 client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL); 127 client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL);
123 128
124 // We close all bindings and ask to be destroyed. 129 // We close all bindings and ask to be destroyed.
(...skipping 12 matching lines...) Expand all
137 binding_.Close(); 142 binding_.Close();
138 delegate_->CloseDialog(); 143 delegate_->CloseDialog();
139 manager_->DestroyRequest(this); 144 manager_->DestroyRequest(this);
140 } 145 }
141 146
142 void PaymentRequest::Pay() { 147 void PaymentRequest::Pay() {
143 state_->GeneratePaymentResponse(); 148 state_->GeneratePaymentResponse();
144 } 149 }
145 150
146 } // namespace payments 151 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698