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

Unified Diff: chrome/browser/resources/options/autofill_options_list.js

Issue 6930052: Revert 84320 - Autofill DOMUI Prefs should work with i18n phone numbers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/autofill_options_list.js
===================================================================
--- chrome/browser/resources/options/autofill_options_list.js (revision 84345)
+++ chrome/browser/resources/options/autofill_options_list.js (working copy)
@@ -125,7 +125,7 @@
if (this.input.value &&
this.list.dataModel.indexOf(this.input.value) == -1) {
// Update with new value.
- this.list.validateAndSave(i, 1, this.input.value);
+ this.list.dataModel.splice(i, 1, this.input.value);
} else {
// Reject empty values and duplicates.
this.list.dataModel.splice(i, 1);
@@ -174,7 +174,7 @@
if (this.input.value &&
this.list.dataModel.indexOf(this.input.value) == -1) {
- this.list.validateAndSave(i, 0, this.input.value);
+ this.list.dataModel.splice(i, 0, this.input.value);
} else {
this.input.value = '';
this.list.dataModel.updateIndex(i);
@@ -303,71 +303,8 @@
deleteItemAtIndex: function(index) {
this.dataModel.splice(index, 1);
},
-
- /**
- * Called when a new list item should be validated; subclasses are
- * responsible for implementing if validation is required.
- * @param {number} index The index of the item that was inserted or changed.
- * @param {number} remove The number items to remove.
- * @param {string} value The value of the item to insert.
- */
- validateAndSave: function(index, remove, value) {
- this.dataModel.splice(index, remove, value);
- },
};
- /**
- * Create a new value list for phone number validation.
- * @constructor
- * @extends {options.AutofillValuesList}
- */
- var AutofillPhoneValuesList = cr.ui.define('list');
-
- AutofillPhoneValuesList.prototype = {
- __proto__: AutofillValuesList.prototype,
-
- decorate: function() {
- AutofillValuesList.prototype.decorate.call(this);
- },
-
- /** @inheritDoc */
- validateAndSave: function(index, remove, value) {
- var numbers = this.dataModel.slice(0, this.dataModel.length - 1);
- numbers.splice(index, remove, value);
- var info = new Array();
- info[0] = index;
- info[1] = numbers;
- info[2] = $('country').value;
- chrome.send('validatePhoneNumbers', info);
- },
- };
-
- /**
- * Create a new value list for fax number validation.
- * @constructor
- * @extends {options.AutofillValuesList}
- */
- var AutofillFaxValuesList = cr.ui.define('list');
-
- AutofillFaxValuesList.prototype = {
- __proto__: AutofillValuesList.prototype,
-
- decorate: function() {
- AutofillValuesList.prototype.decorate.call(this);
- },
-
- /** @inheritDoc */
- validateAndSave: function(index, remove, value) {
- var numbers = this.dataModel.slice(0, this.dataModel.length - 1);
- numbers.splice(index, remove, value);
- var info = new Array();
- info[0] = index;
- info[1] = numbers;
- info[2] = $('country').value;
- chrome.send('validateFaxNumbers', info);
- },
- };
-
return {
AddressListItem: AddressListItem,
CreditCardListItem: CreditCardListItem,
@@ -376,7 +313,5 @@
AutofillAddressList: AutofillAddressList,
AutofillCreditCardList: AutofillCreditCardList,
AutofillValuesList: AutofillValuesList,
- AutofillPhoneValuesList: AutofillPhoneValuesList,
- AutofillFaxValuesList: AutofillFaxValuesList,
};
});

Powered by Google App Engine
This is Rietveld 408576698