| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** | 
| 6  * @typedef {{ | 6  * @typedef {{ | 
| 7  *   creditCardNumber: string, | 7  *   creditCardNumber: string, | 
| 8  *   expirationMonth: string, | 8  *   expirationMonth: string, | 
| 9  *   expirationYear: string, | 9  *   expirationYear: string, | 
| 10  *   guid: string, | 10  *   guid: string, | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 82         } | 82         } | 
| 83       }; | 83       }; | 
| 84 </if> | 84 </if> | 
| 85 | 85 | 
| 86       $('autofill-help').onclick = function(event) { | 86       $('autofill-help').onclick = function(event) { | 
| 87         chrome.send('coreOptionsUserMetricsAction', | 87         chrome.send('coreOptionsUserMetricsAction', | 
| 88                     ['Options_AutofillShowAbout']); | 88                     ['Options_AutofillShowAbout']); | 
| 89         return true;  // Always follow the href | 89         return true;  // Always follow the href | 
| 90       }; | 90       }; | 
| 91 | 91 | 
| 92       var enableWalletIntegration = | 92       this.walletIntegrationAvailableStateChanged_( | 
| 93           loadTimeData.getBoolean('enableAutofillWalletIntegration'); | 93           loadTimeData.getBoolean('autofillWalletIntegrationAvailable')); | 
| 94       $('autofill-wallet-setting-area').hidden = !enableWalletIntegration; |  | 
| 95 | 94 | 
| 96       // TODO(jhawkins): What happens when Autofill is disabled whilst on the | 95       // TODO(jhawkins): What happens when Autofill is disabled whilst on the | 
| 97       // Autofill options page? | 96       // Autofill options page? | 
| 98     }, | 97     }, | 
| 99 | 98 | 
| 100     /** | 99     /** | 
| 101      * Creates, decorates and initializes the address list. | 100      * Creates, decorates and initializes the address list. | 
| 102      * @private | 101      * @private | 
| 103      */ | 102      */ | 
| 104     createAddressList_: function() { | 103     createAddressList_: function() { | 
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 222      * associative array that contains the credit card data. | 221      * associative array that contains the credit card data. | 
| 223      * @param {CreditCardData} creditCard | 222      * @param {CreditCardData} creditCard | 
| 224      * @private | 223      * @private | 
| 225      */ | 224      */ | 
| 226     showEditCreditCardOverlay_: function(creditCard) { | 225     showEditCreditCardOverlay_: function(creditCard) { | 
| 227       var title = loadTimeData.getString('editCreditCardTitle'); | 226       var title = loadTimeData.getString('editCreditCardTitle'); | 
| 228       AutofillEditCreditCardOverlay.setTitle(title); | 227       AutofillEditCreditCardOverlay.setTitle(title); | 
| 229       AutofillEditCreditCardOverlay.loadCreditCard(creditCard); | 228       AutofillEditCreditCardOverlay.loadCreditCard(creditCard); | 
| 230       PageManager.showPageByName('autofillEditCreditCard'); | 229       PageManager.showPageByName('autofillEditCreditCard'); | 
| 231     }, | 230     }, | 
|  | 231 | 
|  | 232     /** | 
|  | 233      * Toggles the visibility of the Wallet integration checkbox. | 
|  | 234      * @param {boolean} available Whether the user has the option of using | 
|  | 235      *     Wallet data. | 
|  | 236      * @private | 
|  | 237      */ | 
|  | 238     walletIntegrationAvailableStateChanged_: function(available) { | 
|  | 239       $('autofill-wallet-setting-area').hidden = !available; | 
|  | 240     }, | 
| 232   }; | 241   }; | 
| 233 | 242 | 
| 234   AutofillOptions.setAddressList = function(entries) { | 243   AutofillOptions.setAddressList = function(entries) { | 
| 235     AutofillOptions.getInstance().setAddressList_(entries); | 244     AutofillOptions.getInstance().setAddressList_(entries); | 
| 236   }; | 245   }; | 
| 237 | 246 | 
| 238   AutofillOptions.setCreditCardList = function(entries) { | 247   AutofillOptions.setCreditCardList = function(entries) { | 
| 239     AutofillOptions.getInstance().setCreditCardList_(entries); | 248     AutofillOptions.getInstance().setCreditCardList_(entries); | 
| 240   }; | 249   }; | 
| 241 | 250 | 
| 242   AutofillOptions.removeData = function(guid, metricsAction) { | 251   AutofillOptions.removeData = function(guid, metricsAction) { | 
| 243     AutofillOptions.getInstance().removeData_(guid, metricsAction); | 252     AutofillOptions.getInstance().removeData_(guid, metricsAction); | 
| 244   }; | 253   }; | 
| 245 | 254 | 
| 246   AutofillOptions.loadAddressEditor = function(entry) { | 255   AutofillOptions.loadAddressEditor = function(entry) { | 
| 247     AutofillOptions.getInstance().loadAddressEditor_(entry); | 256     AutofillOptions.getInstance().loadAddressEditor_(entry); | 
| 248   }; | 257   }; | 
| 249 | 258 | 
| 250   AutofillOptions.loadCreditCardEditor = function(entry) { | 259   AutofillOptions.loadCreditCardEditor = function(entry) { | 
| 251     AutofillOptions.getInstance().loadCreditCardEditor_(entry); | 260     AutofillOptions.getInstance().loadCreditCardEditor_(entry); | 
| 252   }; | 261   }; | 
| 253 | 262 | 
| 254   AutofillOptions.editAddress = function(address) { | 263   AutofillOptions.editAddress = function(address) { | 
| 255     AutofillOptions.getInstance().showEditAddressOverlay_(address); | 264     AutofillOptions.getInstance().showEditAddressOverlay_(address); | 
| 256   }; | 265   }; | 
| 257 | 266 | 
|  | 267   AutofillOptions.walletIntegrationAvailableStateChanged = function(available) { | 
|  | 268     AutofillOptions.getInstance(). | 
|  | 269         walletIntegrationAvailableStateChanged_(available); | 
|  | 270   }; | 
|  | 271 | 
| 258   /** | 272   /** | 
| 259    * @param {CreditCardData} creditCard | 273    * @param {CreditCardData} creditCard | 
| 260    */ | 274    */ | 
| 261   AutofillOptions.editCreditCard = function(creditCard) { | 275   AutofillOptions.editCreditCard = function(creditCard) { | 
| 262     AutofillOptions.getInstance().showEditCreditCardOverlay_(creditCard); | 276     AutofillOptions.getInstance().showEditCreditCardOverlay_(creditCard); | 
| 263   }; | 277   }; | 
| 264 | 278 | 
| 265   // Export | 279   // Export | 
| 266   return { | 280   return { | 
| 267     AutofillOptions: AutofillOptions | 281     AutofillOptions: AutofillOptions | 
| 268   }; | 282   }; | 
| 269 | 283 | 
| 270 }); | 284 }); | 
| 271 | 285 | 
| OLD | NEW | 
|---|