summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2015-06-23 14:53:16 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-23 21:53:52 +0000
commit3cf848d974989da8b46d4e7a8b8373aa5205d607 (patch)
tree8f808095ebadb16b103e89ed1c896df1274f50a1
parent70715cc36015379ea9da83c19076bba5476a02d5 (diff)
downloadchromium_src-3cf848d974989da8b46d4e7a8b8373aa5205d607.zip
chromium_src-3cf848d974989da8b46d4e7a8b8373aa5205d607.tar.gz
chromium_src-3cf848d974989da8b46d4e7a8b8373aa5205d607.tar.bz2
Autofill: Cleanup some TODOs in iOS autofill.
Some code could not be touched earlier since iOS code still uses them. Now that the iOS side has been fixed, we can remove or change the autofill JS code to better match the C++ copy. BUG=427614 Review URL: https://codereview.chromium.org/1205593002 Cr-Commit-Position: refs/heads/master@{#335763}
-rw-r--r--components/autofill/ios/browser/resources/autofill_controller.js42
1 files changed, 15 insertions, 27 deletions
diff --git a/components/autofill/ios/browser/resources/autofill_controller.js b/components/autofill/ios/browser/resources/autofill_controller.js
index a1e0de4..b593103 100644
--- a/components/autofill/ios/browser/resources/autofill_controller.js
+++ b/components/autofill/ios/browser/resources/autofill_controller.js
@@ -415,8 +415,7 @@ function formOrFieldsetsToFormData_(formElement, formControlElement,
* @param {number} requirements The requirements mask for forms, e.g.
* autocomplete attribute state.
* @return {string} A JSON encoded object with object['forms'] containing the
- * forms data and object['has_more_forms'] indicating if there are more
- * forms to extract.
+ * forms data.
*/
__gCrWeb.autofill['extractForms'] = function(requiredFields, requirements) {
var forms = [];
@@ -431,10 +430,6 @@ __gCrWeb.autofill['extractForms'] = function(requiredFields, requirements) {
requirements,
forms);
var results = new __gCrWeb.common.JSONSafeObject;
- // TODO(thestig): This is no longer used, but removing it will require changes
- // internal to iOS, where some unit tests check this value and expects it to
- // be false. Once those are removed, this can be removed.
- results['has_more_forms'] = false;
results['forms'] = forms;
return __gCrWeb.stringify(results);
};
@@ -1471,26 +1466,20 @@ __gCrWeb.autofill.value = function(element) {
/**
* Returns the auto-fillable form control elements in |formElement|.
*
- * It is based on the logic in
- * std::vector<blink::WebFormControlElement> ExtractAutofillableElements(
- * const blink::WebFormElement& form_element,
- * RequirementsMask requirements,
- * std::vector<blink::WebFormControlElement>* autofillable_elements);
+ * It is based on the logic in:
+ * std::vector<blink::WebFormControlElement>
+ * ExtractAutofillableElementsFromSet(
+ * const WebVector<WebFormControlElement>& control_elements,
+ * RequirementsMask requirements);
* in chromium/src/components/autofill/content/renderer/form_autofill_util.h.
*
- * TODO(thestig): This should match ExtractAutofillableElementsFromSet() from
- * r306470 once all internal callers have switched over to
- * extractAutofillableElementsInForm().
- *
- * @param {HTMLFormElement} formElement A form element to be processed.
+ * @param {Array<FormControlElement>} controlElements Set of control elements.
* @param {number} requirementsMask A mask on the requirement.
- * @param {Array<FormControlElement>} autofillableElements The array of
- * autofillable elements.
+ * @return {Array<FormControlElement>} The array of autofillable elements.
*/
-__gCrWeb.autofill.extractAutofillableElements = function(
- formElement, requirementsMask, autofillableElements) {
- var controlElements = __gCrWeb.common.getFormControlElements(formElement);
-
+__gCrWeb.autofill.extractAutofillableElementsFromSet = function(
+ controlElements, requirementsMask) {
+ var autofillableElements = [];
for (var i = 0; i < controlElements.length; ++i) {
var element = controlElements[i];
if (!__gCrWeb.autofill.isAutofillableElement(element)) {
@@ -1511,6 +1500,7 @@ __gCrWeb.autofill.extractAutofillableElements = function(
}
autofillableElements.push(element);
}
+ return autofillableElements;
};
/**
@@ -1528,11 +1518,9 @@ __gCrWeb.autofill.extractAutofillableElements = function(
*/
__gCrWeb.autofill.extractAutofillableElementsInForm = function(
formElement, requirementsMask) {
- var autofillableElements = [];
-
- __gCrWeb.autofill.extractAutofillableElements(
- formElement, requirementsMask, autofillableElements);
- return autofillableElements;
+ var controlElements = __gCrWeb.common.getFormControlElements(formElement);
+ return __gCrWeb.autofill.extractAutofillableElementsFromSet(
+ controlElements, requirementsMask);
};
/**