summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorziran.sun <ziran.sun@samsung.com>2014-09-26 13:01:40 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-26 20:01:53 +0000
commitd9b040ba4ff2ff78f183816b9d0e34c5f450160c (patch)
treef5a714d8a2259158b8278f702ec41413407b681f /components
parent63800d594789b02dbd08107270acc84763fb0c93 (diff)
downloadchromium_src-d9b040ba4ff2ff78f183816b9d0e34c5f450160c.zip
chromium_src-d9b040ba4ff2ff78f183816b9d0e34c5f450160c.tar.gz
chromium_src-d9b040ba4ff2ff78f183816b9d0e34c5f450160c.tar.bz2
[Autofill Clean up] Revert changes introduced by Autocheckout to autofill
disabled and readonly fields. Autocheckout is deprecated. R=isherman@chromium.org BUG=231160 Review URL: https://codereview.chromium.org/609733003 Cr-Commit-Position: refs/heads/master@{#297015}
Diffstat (limited to 'components')
-rw-r--r--components/autofill/content/renderer/form_autofill_util.cc41
-rw-r--r--components/autofill/content/renderer/form_autofill_util.h6
2 files changed, 7 insertions, 40 deletions
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index c6175c9..10d6cca 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -54,17 +54,6 @@ using blink::WebVector;
namespace autofill {
namespace {
-// A bit field mask for FillForm functions to not fill some fields.
-enum FieldFilterMask {
- FILTER_NONE = 0,
- FILTER_DISABLED_ELEMENTS = 1 << 0,
- FILTER_READONLY_ELEMENTS = 1 << 1,
- FILTER_NON_FOCUSABLE_ELEMENTS = 1 << 2,
- FILTER_ALL_NON_EDITIABLE_ELEMENTS = FILTER_DISABLED_ELEMENTS |
- FILTER_READONLY_ELEMENTS |
- FILTER_NON_FOCUSABLE_ELEMENTS,
-};
-
bool IsOptionElement(const WebElement& element) {
CR_DEFINE_STATIC_LOCAL(WebString, kOption, ("option"));
return element.hasHTMLTagName(kOption);
@@ -476,7 +465,7 @@ typedef void (*Callback)(const FormFieldData&,
void ForEachMatchingFormField(const WebFormElement& form_element,
const WebElement& initiating_element,
const FormData& data,
- FieldFilterMask filters,
+ bool only_focusable_elements,
bool force_override,
Callback callback) {
std::vector<WebFormControlElement> control_elements;
@@ -519,9 +508,8 @@ void ForEachMatchingFormField(const WebFormElement& form_element,
!element->value().isEmpty()))
continue;
- if (((filters & FILTER_DISABLED_ELEMENTS) && !element->isEnabled()) ||
- ((filters & FILTER_READONLY_ELEMENTS) && element->isReadOnly()) ||
- ((filters & FILTER_NON_FOCUSABLE_ELEMENTS) && !element->isFocusable()))
+ if (!element->isEnabled() || element->isReadOnly() ||
+ (only_focusable_elements && !element->isFocusable()))
continue;
callback(data.fields[i], is_initiating_element, element);
@@ -1001,8 +989,8 @@ void FillForm(const FormData& form, const WebFormControlElement& element) {
ForEachMatchingFormField(form_element,
element,
form,
- FILTER_ALL_NON_EDITIABLE_ELEMENTS,
- false, /* dont force override */
+ true, /* only_focusable_elements */
+ false, /* don't force override */
&FillFormField);
}
@@ -1011,25 +999,10 @@ void FillFormIncludingNonFocusableElements(const FormData& form_data,
if (form_element.isNull())
return;
- FieldFilterMask filter_mask = static_cast<FieldFilterMask>(
- FILTER_DISABLED_ELEMENTS | FILTER_READONLY_ELEMENTS);
- ForEachMatchingFormField(form_element,
- WebInputElement(),
- form_data,
- filter_mask,
- true, /* force override */
- &FillFormField);
-}
-
-void FillFormForAllElements(const FormData& form_data,
- const WebFormElement& form_element) {
- if (form_element.isNull())
- return;
-
ForEachMatchingFormField(form_element,
WebInputElement(),
form_data,
- FILTER_NONE,
+ false, /* only_focusable_elements */
true, /* force override */
&FillFormField);
}
@@ -1042,7 +1015,7 @@ void PreviewForm(const FormData& form, const WebFormControlElement& element) {
ForEachMatchingFormField(form_element,
element,
form,
- FILTER_ALL_NON_EDITIABLE_ELEMENTS,
+ true, /* only_focusable_elements */
false, /* dont force override */
&PreviewFormField);
}
diff --git a/components/autofill/content/renderer/form_autofill_util.h b/components/autofill/content/renderer/form_autofill_util.h
index 0f0f6c2..bedb73b 100644
--- a/components/autofill/content/renderer/form_autofill_util.h
+++ b/components/autofill/content/renderer/form_autofill_util.h
@@ -133,12 +133,6 @@ void FillFormIncludingNonFocusableElements(
const FormData& form_data,
const blink::WebFormElement& form_element);
-// Fills all (including disabled, read-only and non-focusable) form control
-// elements within |form_element| with field data from |form_data|.
-void FillFormForAllElements(
- const FormData& form_data,
- const blink::WebFormElement& form_element);
-
// Previews the form represented by |form|. |element| is the input element that
// initiated the preview process.
void PreviewForm(const FormData& form,