OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/renderer/autofill/form_autofill_util.h" | 5 #include "chrome/renderer/autofill/form_autofill_util.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/callback_old.h" | 9 #include "base/callback_old.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 field->autocomplete_type = ASCIIToUTF16("x-max-data-length-exceeded"); | 604 field->autocomplete_type = ASCIIToUTF16("x-max-data-length-exceeded"); |
605 } | 605 } |
606 | 606 |
607 if (!IsAutofillableElement(element)) | 607 if (!IsAutofillableElement(element)) |
608 return; | 608 return; |
609 | 609 |
610 const WebInputElement* input_element = toWebInputElement(&element); | 610 const WebInputElement* input_element = toWebInputElement(&element); |
611 if (IsTextInput(input_element)) { | 611 if (IsTextInput(input_element)) { |
612 field->max_length = input_element->maxLength(); | 612 field->max_length = input_element->maxLength(); |
613 field->is_autofilled = input_element->isAutofilled(); | 613 field->is_autofilled = input_element->isAutofilled(); |
| 614 field->is_focusable = input_element->isFocusable(); |
| 615 field->autocomplete = input_element->autoComplete(); |
614 } else if (extract_mask & EXTRACT_OPTIONS) { | 616 } else if (extract_mask & EXTRACT_OPTIONS) { |
615 // Set option strings on the field if available. | 617 // Set option strings on the field if available. |
616 DCHECK(IsSelectElement(element)); | 618 DCHECK(IsSelectElement(element)); |
617 const WebSelectElement select_element = element.toConst<WebSelectElement>(); | 619 const WebSelectElement select_element = element.toConst<WebSelectElement>(); |
618 GetOptionStringsFromElement(select_element, | 620 GetOptionStringsFromElement(select_element, |
619 &field->option_values, | 621 &field->option_values, |
620 &field->option_contents); | 622 &field->option_contents); |
621 } | 623 } |
622 | 624 |
623 if (!(extract_mask & EXTRACT_VALUE)) | 625 if (!(extract_mask & EXTRACT_VALUE)) |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 continue; | 893 continue; |
892 | 894 |
893 if (input_element->isAutofilled()) | 895 if (input_element->isAutofilled()) |
894 return true; | 896 return true; |
895 } | 897 } |
896 | 898 |
897 return false; | 899 return false; |
898 } | 900 } |
899 | 901 |
900 } // namespace autofill | 902 } // namespace autofill |
OLD | NEW |