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

Side by Side Diff: chrome/test/data/android/payments/dynamic_shipping.js

Issue 2093363002: Autofill address editor in PaymentRequest UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@contact-editor
Patch Set: Fix try-bot Created 4 years, 5 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 /* 1 /*
2 * Copyright 2016 The Chromium Authors. All rights reserved. 2 * Copyright 2016 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* global PaymentRequest:false */ 7 /* global PaymentRequest:false */
8 /* global toDictionary:false */ 8 /* global toDictionary:false */
9 9
10 /** 10 /**
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 */ 60 */
61 function updateDetails(details, addr) { 61 function updateDetails(details, addr) {
62 if (addr.country === 'US') { 62 if (addr.country === 'US') {
63 var shippingOption = { 63 var shippingOption = {
64 id: '', 64 id: '',
65 label: '', 65 label: '',
66 amount: {currency: 'USD', value: '0.00'}, 66 amount: {currency: 'USD', value: '0.00'},
67 selected: true 67 selected: true
68 }; 68 };
69 if (addr.region === 'CA') { 69 if (addr.region === 'CA') {
70 shippingOption.id = 'ca'; 70 shippingOption.id = 'californiaShippingOption';
71 shippingOption.label = 'Free shipping in California'; 71 shippingOption.label = 'Free shipping in California';
72 details.total.amount.value = '5.00'; 72 details.total.amount.value = '5.00';
73 } else { 73 } else {
74 shippingOption.id = 'us'; 74 shippingOption.id = 'usShippingOption';
75 shippingOption.label = 'Standard shipping in US'; 75 shippingOption.label = 'Standard shipping in US';
76 shippingOption.amount.value = '5.00'; 76 shippingOption.amount.value = '5.00';
77 details.total.amount.value = '10.00'; 77 details.total.amount.value = '10.00';
78 } 78 }
79 if (details.displayItems.length === 1) { 79 if (details.displayItems.length === 1) {
80 details.displayItems.splice(0, 0, shippingOption); 80 details.displayItems.splice(0, 0, shippingOption);
81 } else { 81 } else {
82 details.displayItems.splice(0, 1, shippingOption); 82 details.displayItems.splice(0, 1, shippingOption);
83 } 83 }
84 details.shippingOptions = [shippingOption]; 84 details.shippingOptions = [shippingOption];
85 } else { 85 } else {
86 delete details.shippingOptions; 86 delete details.shippingOptions;
87 } 87 }
88 return details; 88 return details;
89 } 89 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/android/personal_data_manager_android.cc ('k') | components/autofill/core/browser/autofill_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698