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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentResponse.cpp

Issue 2038423002: Adding support for phone and email. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "modules/payments/PaymentResponse.h" 5 #include "modules/payments/PaymentResponse.h"
6 6
7 #include "bindings/core/v8/JSONValuesForV8.h" 7 #include "bindings/core/v8/JSONValuesForV8.h"
8 #include "modules/payments/PaymentAddress.h" 8 #include "modules/payments/PaymentAddress.h"
9 #include "modules/payments/PaymentCompleter.h" 9 #include "modules/payments/PaymentCompleter.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 PaymentResponse::PaymentResponse(mojom::blink::PaymentResponsePtr response, Paym entCompleter* paymentCompleter) 14 PaymentResponse::PaymentResponse(mojom::blink::PaymentResponsePtr response, Paym entCompleter* paymentCompleter)
15 : m_methodName(response->method_name) 15 : m_methodName(response->method_name)
16 , m_stringifiedDetails(response->stringified_details) 16 , m_stringifiedDetails(response->stringified_details)
17 , m_shippingAddress(response->shipping_address ? new PaymentAddress(std::mov e(response->shipping_address)) : nullptr) 17 , m_shippingAddress(response->shipping_address ? new PaymentAddress(std::mov e(response->shipping_address)) : nullptr)
18 , m_payerEmail(response->payer_email)
zino 2016/06/07 16:40:08 The payerEmail can be null. (It has DOMString? typ
19 , m_payerPhone(response->payer_phone)
zino 2016/06/07 16:40:08 ditto
18 , m_paymentCompleter(paymentCompleter) 20 , m_paymentCompleter(paymentCompleter)
19 { 21 {
20 DCHECK(m_paymentCompleter); 22 DCHECK(m_paymentCompleter);
21 } 23 }
22 24
23 PaymentResponse::~PaymentResponse() 25 PaymentResponse::~PaymentResponse()
24 { 26 {
25 } 27 }
26 28
27 ScriptValue PaymentResponse::details(ScriptState* scriptState, ExceptionState& e xceptionState) const 29 ScriptValue PaymentResponse::details(ScriptState* scriptState, ExceptionState& e xceptionState) const
28 { 30 {
29 return ScriptValue(scriptState, fromJSONString(scriptState, m_stringifiedDet ails, exceptionState)); 31 return ScriptValue(scriptState, fromJSONString(scriptState, m_stringifiedDet ails, exceptionState));
30 } 32 }
31 33
32 ScriptPromise PaymentResponse::complete(ScriptState* scriptState, bool success) 34 ScriptPromise PaymentResponse::complete(ScriptState* scriptState, bool success)
33 { 35 {
34 return m_paymentCompleter->complete(scriptState, success); 36 return m_paymentCompleter->complete(scriptState, success);
35 } 37 }
36 38
37 DEFINE_TRACE(PaymentResponse) 39 DEFINE_TRACE(PaymentResponse)
38 { 40 {
39 visitor->trace(m_shippingAddress); 41 visitor->trace(m_shippingAddress);
40 visitor->trace(m_paymentCompleter); 42 visitor->trace(m_paymentCompleter);
41 } 43 }
42 44
43 } // namespace blink 45 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698