| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/autofill/content/renderer/form_autofill_util.h" | 5 #include "components/autofill/content/renderer/form_autofill_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "components/autofill/core/common/autofill_data_sanitizer.h" |
| 15 #include "components/autofill/core/common/autofill_switches.h" | 16 #include "components/autofill/core/common/autofill_switches.h" |
| 16 #include "components/autofill/core/common/form_data.h" | 17 #include "components/autofill/core/common/form_data.h" |
| 17 #include "components/autofill/core/common/form_field_data.h" | 18 #include "components/autofill/core/common/form_field_data.h" |
| 18 #include "components/autofill/core/common/web_element_descriptor.h" | 19 #include "components/autofill/core/common/web_element_descriptor.h" |
| 19 #include "third_party/WebKit/public/platform/WebString.h" | 20 #include "third_party/WebKit/public/platform/WebString.h" |
| 20 #include "third_party/WebKit/public/platform/WebVector.h" | 21 #include "third_party/WebKit/public/platform/WebVector.h" |
| 21 #include "third_party/WebKit/public/web/WebDocument.h" | 22 #include "third_party/WebKit/public/web/WebDocument.h" |
| 22 #include "third_party/WebKit/public/web/WebElement.h" | 23 #include "third_party/WebKit/public/web/WebElement.h" |
| 23 #include "third_party/WebKit/public/web/WebExceptionCode.h" | 24 #include "third_party/WebKit/public/web/WebExceptionCode.h" |
| 24 #include "third_party/WebKit/public/web/WebFormControlElement.h" | 25 #include "third_party/WebKit/public/web/WebFormControlElement.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 44 using blink::WebNodeList; | 45 using blink::WebNodeList; |
| 45 using blink::WebOptionElement; | 46 using blink::WebOptionElement; |
| 46 using blink::WebSelectElement; | 47 using blink::WebSelectElement; |
| 47 using blink::WebTextAreaElement; | 48 using blink::WebTextAreaElement; |
| 48 using blink::WebString; | 49 using blink::WebString; |
| 49 using blink::WebVector; | 50 using blink::WebVector; |
| 50 | 51 |
| 51 namespace autofill { | 52 namespace autofill { |
| 52 namespace { | 53 namespace { |
| 53 | 54 |
| 54 // The maximum length allowed for form data. | |
| 55 const size_t kMaxDataLength = 1024; | |
| 56 | |
| 57 // A bit field mask for FillForm functions to not fill some fields. | 55 // A bit field mask for FillForm functions to not fill some fields. |
| 58 enum FieldFilterMask { | 56 enum FieldFilterMask { |
| 59 FILTER_NONE = 0, | 57 FILTER_NONE = 0, |
| 60 FILTER_DISABLED_ELEMENTS = 1 << 0, | 58 FILTER_DISABLED_ELEMENTS = 1 << 0, |
| 61 FILTER_READONLY_ELEMENTS = 1 << 1, | 59 FILTER_READONLY_ELEMENTS = 1 << 1, |
| 62 FILTER_NON_FOCUSABLE_ELEMENTS = 1 << 2, | 60 FILTER_NON_FOCUSABLE_ELEMENTS = 1 << 2, |
| 63 FILTER_ALL_NON_EDITIABLE_ELEMENTS = FILTER_DISABLED_ELEMENTS | | 61 FILTER_ALL_NON_EDITIABLE_ELEMENTS = FILTER_DISABLED_ELEMENTS | |
| 64 FILTER_READONLY_ELEMENTS | | 62 FILTER_READONLY_ELEMENTS | |
| 65 FILTER_NON_FOCUSABLE_ELEMENTS, | 63 FILTER_NON_FOCUSABLE_ELEMENTS, |
| 66 }; | 64 }; |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 break; | 1149 break; |
| 1152 } | 1150 } |
| 1153 } | 1151 } |
| 1154 if (!tag_is_allowed) | 1152 if (!tag_is_allowed) |
| 1155 return false; | 1153 return false; |
| 1156 } | 1154 } |
| 1157 return true; | 1155 return true; |
| 1158 } | 1156 } |
| 1159 | 1157 |
| 1160 } // namespace autofill | 1158 } // namespace autofill |
| OLD | NEW |