Commit 1a7a154d authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Do not consider event on unfocusable fields

These fields cannot be filled, so ignore event on them.

Test: autofilling shipping address in shop.economist.com
Bug: 
Change-Id: I0c754b61da4c6cadda912ce10dfd2edd43285719
Reviewed-on: https://chromium-review.googlesource.com/749947Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Reviewed-by: default avatarRoger McFarlane <rogerm@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Reviewed-by: default avatarMoe Ahmadi (slow) <mahmadi@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517411}
parent 923f4e28
......@@ -55,8 +55,9 @@ using FormDataVector = std::vector<autofill::FormData>;
// |fetchFormsWithName:minimumRequiredFieldsCount:pageURL:completionHandler|
typedef void (^FetchFormsCompletionHandler)(BOOL, const FormDataVector&);
// Gets the first form and field specified by |fieldName| from |forms|,
// modifying the returned field so that input elements are also handled.
// Gets the first focusable form and field specified by |fieldName| from
// |forms|, modifying the returned field so that input elements are also
// handled.
void GetFormAndField(autofill::FormData* form,
autofill::FormFieldData* field,
const FormDataVector& forms,
......@@ -66,7 +67,7 @@ void GetFormAndField(autofill::FormData* form,
*form = forms[0];
const base::string16 fieldName16 = base::UTF8ToUTF16(fieldName);
for (const auto& currentField : form->fields) {
if (currentField.name == fieldName16) {
if (currentField.name == fieldName16 && currentField.is_focusable) {
*field = currentField;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment