| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/string16.h" | 7 #include "base/string16.h" |
| 8 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 return result; | 36 return result; |
| 37 } | 37 } |
| 38 | 38 |
| 39 void FormFieldValues::ExtractFormFieldValues(const WebFormElement& form) { | 39 void FormFieldValues::ExtractFormFieldValues(const WebFormElement& form) { |
| 40 WebVector<WebInputElement> input_elements; | 40 WebVector<WebInputElement> input_elements; |
| 41 form.getInputElements(input_elements); | 41 form.getInputElements(input_elements); |
| 42 | 42 |
| 43 for (size_t i = 0; i < input_elements.size(); i++) { | 43 for (size_t i = 0; i < input_elements.size(); i++) { |
| 44 const WebInputElement& input_element = input_elements[i]; | 44 const WebInputElement& input_element = input_elements[i]; |
| 45 if (input_element.isEnabledFormControl()) { | 45 if (input_element.isEnabledFormControl()) { |
| 46 // TODO(jhawkins): Remove this check when we have labels. | 46 // TODO(jhawkins): Remove the check nameForAutofill().isEmpty() when we |
| 47 if (!input_element.nameForAutofill().isEmpty()) | 47 // have labels. |
| 48 if (input_element.autoComplete() && |
| 49 input_element.inputType() != WebInputElement::Password && |
| 50 !input_element.nameForAutofill().isEmpty()) { |
| 48 elements.push_back(FormField(input_element)); | 51 elements.push_back(FormField(input_element)); |
| 52 } |
| 49 } | 53 } |
| 50 } | 54 } |
| 51 } | 55 } |
| 52 | 56 |
| 53 } // namespace webkit_glue | 57 } // namespace webkit_glue |
| OLD | NEW |