OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/content/renderer/password_form_conversion_utils.h" | 5 #include "components/autofill/content/renderer/password_form_conversion_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 if (!input_element || !input_element->isEnabled()) | 247 if (!input_element || !input_element->isEnabled()) |
248 continue; | 248 continue; |
249 | 249 |
250 if (input_element->isTextField()) { | 250 if (input_element->isTextField()) { |
251 if (input_element->isPasswordField()) | 251 if (input_element->isPasswordField()) |
252 layout_sequence.push_back('P'); | 252 layout_sequence.push_back('P'); |
253 else | 253 else |
254 layout_sequence.push_back('N'); | 254 layout_sequence.push_back('N'); |
255 } | 255 } |
256 | 256 |
257 if (input_element->isPasswordField()) { | 257 // If the password field is readonly, the page is likely using a virtual |
258 // keyboard and bypassing the password field value (see http://crbug.com/475 488) | |
vabr (Chromium)
2015/04/10 10:45:38
nit: Also, a full-stop (".") is missing after the
vabr (Chromium)
2015/04/10 10:45:38
nit: Here the comment ran over the 80 characters p
ramya.v
2015/04/13 03:01:44
Done.
ramya.v
2015/04/13 03:01:44
Done.
| |
259 // There is nothing Chrome can do to fill passwords for now. | |
260 if (input_element->isPasswordField() && (!input_element->isReadOnly() || | |
261 HasAutocompleteAttributeValue(*input_element, "current_password") || | |
262 HasAutocompleteAttributeValue(*input_element, "new-password"))) { | |
258 passwords.push_back(*input_element); | 263 passwords.push_back(*input_element); |
259 // If we have not yet considered any element to be the username so far, | 264 // If we have not yet considered any element to be the username so far, |
260 // provisionally select the input element just before the first password | 265 // provisionally select the input element just before the first password |
261 // element to be the username. This choice will be overruled if we later | 266 // element to be the username. This choice will be overruled if we later |
262 // find an element with autocomplete='username'. | 267 // find an element with autocomplete='username'. |
263 if (username_element.isNull() && !latest_input_element.isNull()) { | 268 if (username_element.isNull() && !latest_input_element.isNull()) { |
264 username_element = latest_input_element; | 269 username_element = latest_input_element; |
265 // Remove the selected username from other_possible_usernames. | 270 // Remove the selected username from other_possible_usernames. |
266 if (!latest_input_element.value().isEmpty()) { | 271 if (!latest_input_element.value().isEmpty()) { |
267 DCHECK(!other_possible_usernames.empty()); | 272 DCHECK(!other_possible_usernames.empty()); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 blink::WebFormControlElement(), | 448 blink::WebFormControlElement(), |
444 REQUIRE_NONE, | 449 REQUIRE_NONE, |
445 EXTRACT_NONE, | 450 EXTRACT_NONE, |
446 &password_form->form_data, | 451 &password_form->form_data, |
447 NULL /* FormFieldData */); | 452 NULL /* FormFieldData */); |
448 | 453 |
449 return password_form.Pass(); | 454 return password_form.Pass(); |
450 } | 455 } |
451 | 456 |
452 } // namespace autofill | 457 } // namespace autofill |
OLD | NEW |