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

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

Issue 2578323006: Parsing new Android Pay Payment Request API member: minGooglePlayServicesVersion (Closed)
Patch Set: making minGooglePlayServicesVersion an int32 Created 4 years 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/PaymentRequest.h" 5 #include "modules/payments/PaymentRequest.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8StringResource.h" 10 #include "bindings/core/v8/V8StringResource.h"
(...skipping 17 matching lines...) Expand all
28 #include "modules/payments/PaymentShippingOption.h" 28 #include "modules/payments/PaymentShippingOption.h"
29 #include "modules/payments/PaymentsValidators.h" 29 #include "modules/payments/PaymentsValidators.h"
30 #include "mojo/public/cpp/bindings/interface_request.h" 30 #include "mojo/public/cpp/bindings/interface_request.h"
31 #include "mojo/public/cpp/bindings/wtf_array.h" 31 #include "mojo/public/cpp/bindings/wtf_array.h"
32 #include "platform/RuntimeEnabledFeatures.h" 32 #include "platform/RuntimeEnabledFeatures.h"
33 #include "platform/mojo/MojoHelper.h" 33 #include "platform/mojo/MojoHelper.h"
34 #include "public/platform/InterfaceProvider.h" 34 #include "public/platform/InterfaceProvider.h"
35 #include "public/platform/Platform.h" 35 #include "public/platform/Platform.h"
36 #include "public/platform/WebTraceLocation.h" 36 #include "public/platform/WebTraceLocation.h"
37 #include "wtf/HashSet.h" 37 #include "wtf/HashSet.h"
38 #include "wtf/text/WTFString.h"
please use gerrit instead 2016/12/19 21:47:38 Already included in PaymnentRequest.h, so no need
Walter Cacau 2016/12/19 22:16:54 Done.
38 #include <stddef.h> 39 #include <stddef.h>
39 #include <utility> 40 #include <utility>
40 41
41 using payments::mojom::blink::CanMakePaymentQueryResult; 42 using payments::mojom::blink::CanMakePaymentQueryResult;
42 using payments::mojom::blink::PaymentAddressPtr; 43 using payments::mojom::blink::PaymentAddressPtr;
43 using payments::mojom::blink::PaymentCurrencyAmount; 44 using payments::mojom::blink::PaymentCurrencyAmount;
44 using payments::mojom::blink::PaymentCurrencyAmountPtr; 45 using payments::mojom::blink::PaymentCurrencyAmountPtr;
45 using payments::mojom::blink::PaymentDetailsModifierPtr; 46 using payments::mojom::blink::PaymentDetailsModifierPtr;
46 using payments::mojom::blink::PaymentDetailsPtr; 47 using payments::mojom::blink::PaymentDetailsPtr;
47 using payments::mojom::blink::PaymentErrorReason; 48 using payments::mojom::blink::PaymentErrorReason;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 V8AndroidPayMethodData::toImpl(input.isolate(), input.v8Value(), androidPay, 246 V8AndroidPayMethodData::toImpl(input.isolate(), input.v8Value(), androidPay,
246 dummyExceptionState); 247 dummyExceptionState);
247 if (dummyExceptionState.hadException()) 248 if (dummyExceptionState.hadException())
248 return; 249 return;
249 250
250 if (androidPay.hasEnvironment() && androidPay.environment() == "TEST") 251 if (androidPay.hasEnvironment() && androidPay.environment() == "TEST")
251 output->environment = payments::mojom::blink::AndroidPayEnvironment::TEST; 252 output->environment = payments::mojom::blink::AndroidPayEnvironment::TEST;
252 253
253 output->merchant_name = androidPay.merchantName(); 254 output->merchant_name = androidPay.merchantName();
254 output->merchant_id = androidPay.merchantId(); 255 output->merchant_id = androidPay.merchantId();
255 256
please use gerrit instead 2016/12/19 21:47:38 You should initialize output->min_google_play_serv
Walter Cacau 2016/12/19 22:16:54 Done.
257 if (androidPay.hasMinGooglePlayServicesVersion()) {
258 bool ok = false;
259 int minGooglePlayServicesVersion =
260 androidPay.minGooglePlayServicesVersion().toIntStrict(&ok);
261 if (ok) {
262 output->min_google_play_services_version = minGooglePlayServicesVersion;
263 }
264 }
265
256 if (androidPay.hasAllowedCardNetworks()) { 266 if (androidPay.hasAllowedCardNetworks()) {
257 for (const String& allowedCardNetwork : androidPay.allowedCardNetworks()) { 267 for (const String& allowedCardNetwork : androidPay.allowedCardNetworks()) {
258 for (size_t i = 0; i < arraysize(kAndroidPayNetwork); ++i) { 268 for (size_t i = 0; i < arraysize(kAndroidPayNetwork); ++i) {
259 if (allowedCardNetwork == kAndroidPayNetwork[i].name) { 269 if (allowedCardNetwork == kAndroidPayNetwork[i].name) {
260 output->allowed_card_networks.append(kAndroidPayNetwork[i].code); 270 output->allowed_card_networks.append(kAndroidPayNetwork[i].code);
261 break; 271 break;
262 } 272 }
263 } 273 }
264 } 274 }
265 } 275 }
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 m_completeResolver.clear(); 921 m_completeResolver.clear();
912 m_showResolver.clear(); 922 m_showResolver.clear();
913 m_abortResolver.clear(); 923 m_abortResolver.clear();
914 m_canMakePaymentResolver.clear(); 924 m_canMakePaymentResolver.clear();
915 if (m_clientBinding.is_bound()) 925 if (m_clientBinding.is_bound())
916 m_clientBinding.Close(); 926 m_clientBinding.Close();
917 m_paymentProvider.reset(); 927 m_paymentProvider.reset();
918 } 928 }
919 929
920 } // namespace blink 930 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698