From 8fee844e924295356c75ac88d20dd8e48638da3a Mon Sep 17 00:00:00 2001 From: "dhollowa@chromium.org" Date: Thu, 28 Oct 2010 00:28:03 +0000 Subject: Autofill deprecate unique_ids in favor of guids for DOMUI Removes use of labels and unique_ids in the Autofill options handler in DOMUI. BUG=58813 TEST=Manual tests with DOMUI: Add, Update, and Delete both addresses and credit cards. Review URL: http://codereview.chromium.org/4145008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64186 0039d316-1c4b-4281-b951-d872f2087c98 --- .../browser/resources/options/autofill_options.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'chrome/browser/resources/options/autofill_options.js') diff --git a/chrome/browser/resources/options/autofill_options.js b/chrome/browser/resources/options/autofill_options.js index 4ee8122..3b662f2 100644 --- a/chrome/browser/resources/options/autofill_options.js +++ b/chrome/browser/resources/options/autofill_options.js @@ -23,8 +23,8 @@ cr.define('options', function() { this.numAddresses = 0; this.numCreditCards = 0; this.activeNavTab = null; - this.addressIDs = null; - this.creditCardIDs = null; + this.addressGUIDs = null; + this.creditCardGUIDs = null; OptionsPage.call(this, 'autoFillOptions', templateData.autoFillOptionsTitle, 'autoFillOptionsPage'); @@ -150,11 +150,11 @@ cr.define('options', function() { var profileList = $('profileList'); var blankAddress = profileList.options[addressOffset]; this.numAddresses = addresses.length; - this.addressIDs = new Array(this.numAddresses); + this.addressGUIDs = new Array(this.numAddresses); for (var i = 0; i < this.numAddresses; i++) { var address = addresses[i]; var option = new Option(address['label']); - this.addressIDs[i] = address['uniqueID']; + this.addressGUIDs[i] = address['guid']; profileList.add(option, blankAddress); } @@ -170,11 +170,11 @@ cr.define('options', function() { this.resetCreditCards_(); var profileList = $('profileList'); this.numCreditCards = creditCards.length; - this.creditCardIDs = new Array(this.numCreditCards); + this.creditCardGUIDs = new Array(this.numCreditCards); for (var i = 0; i < this.numCreditCards; i++) { var creditCard = creditCards[i]; var option = new Option(creditCard['label']); - this.creditCardIDs[i] = creditCard['uniqueID']; + this.creditCardGUIDs[i] = creditCard['guid']; profileList.add(option, null); } @@ -205,10 +205,9 @@ cr.define('options', function() { editProfile_: function() { var idx = $('profileList').selectedIndex; if ((profileIndex = this.getAddressIndex_(idx)) != -1) { - chrome.send('editAddress', [String(this.addressIDs[profileIndex])]); + chrome.send('editAddress', [this.addressGUIDs[profileIndex]]); } else if ((profileIndex = this.getCreditCardIndex_(idx)) != -1) { - chrome.send('editCreditCard', - [String(this.creditCardIDs[profileIndex])]); + chrome.send('editCreditCard', [this.creditCardGUIDs[profileIndex]]); } }, @@ -220,10 +219,9 @@ cr.define('options', function() { removeProfile_: function() { var idx = $('profileList').selectedIndex; if ((profileIndex = this.getAddressIndex_(idx)) != -1) - chrome.send('removeAddress', [String(this.addressIDs[profileIndex])]); + chrome.send('removeAddress', [this.addressGUIDs[profileIndex]]); else if ((profileIndex = this.getCreditCardIndex_(idx)) != -1) - chrome.send('removeCreditCard', - [String(this.creditCardIDs[profileIndex])]); + chrome.send('removeCreditCard', [this.creditCardGUIDs[profileIndex]]); }, /** -- cgit v1.1