Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1441)

Unified Diff: chrome/renderer/autofill/form_autofill_util.cc

Issue 12084024: Use WebInputElement.isCheckbox() and isRadioButton() API being exposed by https://bugs.webkit.org/s… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added TODO for select. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/autofill/heuristics/output/02_checkout_advanceautoparts.com.out » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/autofill/form_autofill_util.cc
diff --git a/chrome/renderer/autofill/form_autofill_util.cc b/chrome/renderer/autofill/form_autofill_util.cc
index 9b5cd05aac90560a9732959c0777e0d44bbf2e44..407ebf91083c39b08ad7c3e5a0a1802558346a37 100644
--- a/chrome/renderer/autofill/form_autofill_util.cc
+++ b/chrome/renderer/autofill/form_autofill_util.cc
@@ -570,25 +570,19 @@ bool IsTextInput(const WebInputElement* element) {
bool IsSelectElement(const WebFormControlElement& element) {
// Is static for improving performance.
CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one"));
+ // TODO: Fix issue 172665 by avoiding string comparision.
Ilya Sherman 2013/01/28 21:14:53 TODO's should have names associated with them, e.g
Raman Kakilate 2013/01/29 21:49:27 Removed the comment as issue is filed.
return element.formControlType() == kSelectOne;
}
bool IsCheckableElement(const WebInputElement* element) {
- // Is static for improving performance.
- CR_DEFINE_STATIC_LOCAL(WebString, kRadio, ("radio"));
- CR_DEFINE_STATIC_LOCAL(WebString, kCheckbox, ("checkbox"));
-
if (!element)
return false;
- WebString formControlType = element->formControlType();
- return formControlType == kCheckbox || formControlType == kRadio;
+ return element->isCheckbox() || element->isRadioButton();
}
bool IsAutofillableInputElement(const WebInputElement* element) {
- // TODO(ramankk): Uncomment IsCheckableElement part once we have solution
- // for the observed performance regression.
- return IsTextInput(element); // || IsCheckableElement(element);
+ return IsTextInput(element) || IsCheckableElement(element);
}
const string16 GetFormIdentifier(const WebFormElement& form) {
« no previous file with comments | « no previous file | chrome/test/data/autofill/heuristics/output/02_checkout_advanceautoparts.com.out » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698