OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/form_autofill_util.h" | 5 #include "components/autofill/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" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 NOTREACHED(); | 583 NOTREACHED(); |
584 return "UNKNOWN"; | 584 return "UNKNOWN"; |
585 } | 585 } |
586 | 586 |
587 } // namespace | 587 } // namespace |
588 | 588 |
589 namespace autofill { | 589 namespace autofill { |
590 | 590 |
591 const size_t kMaxParseableFields = 100; | 591 const size_t kMaxParseableFields = 100; |
592 | 592 |
593 // In HTML5, all text fields except password are text input fields to | 593 // All text fields, including password fields, should be extracted. |
594 // autocomplete. | |
595 bool IsTextInput(const WebInputElement* element) { | 594 bool IsTextInput(const WebInputElement* element) { |
596 if (!element) | 595 return element && element->isTextField(); |
597 return false; | |
598 | |
599 return element->isTextField() && !element->isPasswordField(); | |
600 } | 596 } |
601 | 597 |
602 bool IsSelectElement(const WebFormControlElement& element) { | 598 bool IsSelectElement(const WebFormControlElement& element) { |
603 // Is static for improving performance. | 599 // Is static for improving performance. |
604 CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one")); | 600 CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one")); |
605 return element.formControlType() == kSelectOne; | 601 return element.formControlType() == kSelectOne; |
606 } | 602 } |
607 | 603 |
608 bool IsCheckableElement(const WebInputElement* element) { | 604 bool IsCheckableElement(const WebInputElement* element) { |
609 if (!element) | 605 if (!element) |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 continue; | 1019 continue; |
1024 | 1020 |
1025 if (input_element->isAutofilled()) | 1021 if (input_element->isAutofilled()) |
1026 return true; | 1022 return true; |
1027 } | 1023 } |
1028 | 1024 |
1029 return false; | 1025 return false; |
1030 } | 1026 } |
1031 | 1027 |
1032 } // namespace autofill | 1028 } // namespace autofill |
OLD | NEW |