summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options/autofill_options.js
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-11-18 18:32:45 +0000
committerBen Murdoch <benm@google.com>2010-11-18 18:38:07 +0000
commit513209b27ff55e2841eac0e4120199c23acce758 (patch)
treeaeba30bb08c5f47c57003544e378a377c297eee6 /chrome/browser/resources/options/autofill_options.js
parent164f7496de0fbee436b385a79ead9e3cb81a50c1 (diff)
downloadexternal_chromium-513209b27ff55e2841eac0e4120199c23acce758.zip
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.gz
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.bz2
Merge Chromium at r65505: Initial merge by git.
Change-Id: I31d8f1d8cd33caaf7f47ffa7350aef42d5fbdb45
Diffstat (limited to 'chrome/browser/resources/options/autofill_options.js')
-rw-r--r--chrome/browser/resources/options/autofill_options.js26
1 files changed, 12 insertions, 14 deletions
diff --git a/chrome/browser/resources/options/autofill_options.js b/chrome/browser/resources/options/autofill_options.js
index 4b606ec..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');
@@ -43,7 +43,8 @@ cr.define('options', function() {
self.updateButtonState_();
};
$('profileList').addEventListener('dblclick', function(event) {
- self.editProfile_();
+ if ($('autoFillEnabled').checked)
+ self.editProfile_();
});
$('addAddressButton').onclick = function(event) {
self.showAddAddressOverlay_();
@@ -149,15 +150,14 @@ 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);
}
- AutoFillEditCreditCardOverlay.setBillingAddresses(addresses);
this.updateButtonState_();
},
@@ -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]]);
},
/**