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

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: review comments Created 3 years, 12 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 | « third_party/WebKit/Source/modules/payments/AndroidPayMethodData.idl ('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 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 dummyExceptionState); 246 dummyExceptionState);
247 if (dummyExceptionState.hadException()) 247 if (dummyExceptionState.hadException())
248 return; 248 return;
249 249
250 if (androidPay.hasEnvironment() && androidPay.environment() == "TEST") 250 if (androidPay.hasEnvironment() && androidPay.environment() == "TEST")
251 output->environment = payments::mojom::blink::AndroidPayEnvironment::TEST; 251 output->environment = payments::mojom::blink::AndroidPayEnvironment::TEST;
252 252
253 output->merchant_name = androidPay.merchantName(); 253 output->merchant_name = androidPay.merchantName();
254 output->merchant_id = androidPay.merchantId(); 254 output->merchant_id = androidPay.merchantId();
255 255
256 // 0 means the merchant did not specify or it was an invalid value
257 output->min_google_play_services_version = 0;
258 if (androidPay.hasMinGooglePlayServicesVersion()) {
259 bool ok = false;
260 int minGooglePlayServicesVersion =
261 androidPay.minGooglePlayServicesVersion().toIntStrict(&ok);
262 if (ok) {
263 output->min_google_play_services_version = minGooglePlayServicesVersion;
264 }
265 }
266
256 if (androidPay.hasAllowedCardNetworks()) { 267 if (androidPay.hasAllowedCardNetworks()) {
257 for (const String& allowedCardNetwork : androidPay.allowedCardNetworks()) { 268 for (const String& allowedCardNetwork : androidPay.allowedCardNetworks()) {
258 for (size_t i = 0; i < arraysize(kAndroidPayNetwork); ++i) { 269 for (size_t i = 0; i < arraysize(kAndroidPayNetwork); ++i) {
259 if (allowedCardNetwork == kAndroidPayNetwork[i].name) { 270 if (allowedCardNetwork == kAndroidPayNetwork[i].name) {
260 output->allowed_card_networks.append(kAndroidPayNetwork[i].code); 271 output->allowed_card_networks.append(kAndroidPayNetwork[i].code);
261 break; 272 break;
262 } 273 }
263 } 274 }
264 } 275 }
265 } 276 }
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 m_completeResolver.clear(); 922 m_completeResolver.clear();
912 m_showResolver.clear(); 923 m_showResolver.clear();
913 m_abortResolver.clear(); 924 m_abortResolver.clear();
914 m_canMakePaymentResolver.clear(); 925 m_canMakePaymentResolver.clear();
915 if (m_clientBinding.is_bound()) 926 if (m_clientBinding.is_bound())
916 m_clientBinding.Close(); 927 m_clientBinding.Close();
917 m_paymentProvider.reset(); 928 m_paymentProvider.reset();
918 } 929 }
919 930
920 } // namespace blink 931 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/payments/AndroidPayMethodData.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698