| 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 "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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 } | 568 } |
| 569 | 569 |
| 570 bool IsSelectElement(const WebFormControlElement& element) { | 570 bool IsSelectElement(const WebFormControlElement& element) { |
| 571 // Is static for improving performance. | 571 // Is static for improving performance. |
| 572 CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one")); | 572 CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one")); |
| 573 return element.formControlType() == kSelectOne; | 573 return element.formControlType() == kSelectOne; |
| 574 } | 574 } |
| 575 | 575 |
| 576 bool IsCheckableElement(const WebInputElement* element) { | 576 bool IsCheckableElement(const WebInputElement* element) { |
| 577 // Is static for improving performance. | 577 // Is static for improving performance. |
| 578 CR_DEFINE_STATIC_LOCAL(WebString, kRadio, ("radio")); | 578 // TODO(ramankk): Uncomment kRadio part after testing for regression. |
| 579 // CR_DEFINE_STATIC_LOCAL(WebString, kRadio, ("radio")); |
| 579 CR_DEFINE_STATIC_LOCAL(WebString, kCheckbox, ("checkbox")); | 580 CR_DEFINE_STATIC_LOCAL(WebString, kCheckbox, ("checkbox")); |
| 580 | 581 |
| 581 if (!element) | 582 if (!element) |
| 582 return false; | 583 return false; |
| 583 | 584 |
| 584 WebString formControlType = element->formControlType(); | 585 WebString formControlType = element->formControlType(); |
| 585 return formControlType == kCheckbox || formControlType == kRadio; | 586 // TODO(ramankk): Uncomment kRadio part after testing for regression. |
| 587 return formControlType == kCheckbox; // || formControlType == kRadio; |
| 586 } | 588 } |
| 587 | 589 |
| 588 bool IsAutofillableInputElement(const WebInputElement* element) { | 590 bool IsAutofillableInputElement(const WebInputElement* element) { |
| 589 return IsTextInput(element) || IsCheckableElement(element); | 591 return IsTextInput(element) || IsCheckableElement(element); |
| 590 } | 592 } |
| 591 | 593 |
| 592 const string16 GetFormIdentifier(const WebFormElement& form) { | 594 const string16 GetFormIdentifier(const WebFormElement& form) { |
| 593 string16 identifier = form.name(); | 595 string16 identifier = form.name(); |
| 594 if (identifier.empty()) | 596 if (identifier.empty()) |
| 595 identifier = form.getAttribute(WebString("id")); | 597 identifier = form.getAttribute(WebString("id")); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 continue; | 987 continue; |
| 986 | 988 |
| 987 if (input_element->isAutofilled()) | 989 if (input_element->isAutofilled()) |
| 988 return true; | 990 return true; |
| 989 } | 991 } |
| 990 | 992 |
| 991 return false; | 993 return false; |
| 992 } | 994 } |
| 993 | 995 |
| 994 } // namespace autofill | 996 } // namespace autofill |
| OLD | NEW |