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

Side by Side Diff: components/autofill/content/renderer/password_form_conversion_utils.cc

Issue 2769023003: [Password Manager] Check node visibility with isFocusable instead of hasNonEmptyLayoutSize (Closed)
Patch Set: Added comment to IsWebElementVisible Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 *found_visible_password = false; 349 *found_visible_password = false;
350 *found_visible_username_before_visible_password = false; 350 *found_visible_username_before_visible_password = false;
351 351
352 bool found_visible_username = false; 352 bool found_visible_username = false;
353 for (auto& control_element : form.control_elements) { 353 for (auto& control_element : form.control_elements) {
354 const WebInputElement* input_element = toWebInputElement(&control_element); 354 const WebInputElement* input_element = toWebInputElement(&control_element);
355 if (!input_element || !input_element->isEnabled() || 355 if (!input_element || !input_element->isEnabled() ||
356 !input_element->isTextField()) 356 !input_element->isTextField())
357 continue; 357 continue;
358 358
359 if (!form_util::IsWebNodeVisible(*input_element)) 359 if (!form_util::IsWebElementVisible(*input_element))
360 continue; 360 continue;
361 361
362 if (input_element->isPasswordField()) { 362 if (input_element->isPasswordField()) {
363 *found_visible_password = true; 363 *found_visible_password = true;
364 *found_visible_username_before_visible_password = found_visible_username; 364 *found_visible_username_before_visible_password = found_visible_username;
365 break; 365 break;
366 } else { 366 } else {
367 found_visible_username = true; 367 found_visible_username = true;
368 } 368 }
369 } 369 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 for (size_t i = 0; i < form.control_elements.size(); ++i) { 423 for (size_t i = 0; i < form.control_elements.size(); ++i) {
424 WebFormControlElement control_element = form.control_elements[i]; 424 WebFormControlElement control_element = form.control_elements[i];
425 425
426 WebInputElement* input_element = toWebInputElement(&control_element); 426 WebInputElement* input_element = toWebInputElement(&control_element);
427 if (!input_element || !input_element->isEnabled()) 427 if (!input_element || !input_element->isEnabled())
428 continue; 428 continue;
429 429
430 if (HasCreditCardAutocompleteAttributes(*input_element)) 430 if (HasCreditCardAutocompleteAttributes(*input_element))
431 continue; 431 continue;
432 432
433 bool element_is_invisible = !form_util::IsWebNodeVisible(*input_element); 433 bool element_is_invisible = !form_util::IsWebElementVisible(*input_element);
434 if (input_element->isTextField()) { 434 if (input_element->isTextField()) {
435 if (input_element->isPasswordField()) { 435 if (input_element->isPasswordField()) {
436 if (element_is_invisible && ignore_invisible_passwords) 436 if (element_is_invisible && ignore_invisible_passwords)
437 continue; 437 continue;
438 layout_sequence.push_back('P'); 438 layout_sequence.push_back('P');
439 } else { 439 } else {
440 if (FieldHasNonscriptModifiedValue(field_value_and_properties_map, 440 if (FieldHasNonscriptModifiedValue(field_value_and_properties_map,
441 *input_element)) 441 *input_element))
442 ++number_of_non_empty_text_non_password_fields; 442 ++number_of_non_empty_text_non_password_fields;
443 if (element_is_invisible && ignore_invisible_usernames) 443 if (element_is_invisible && ignore_invisible_usernames)
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { 760 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
761 if (base::StartsWith(token, kAutocompleteCreditCardPrefix, 761 if (base::StartsWith(token, kAutocompleteCreditCardPrefix,
762 base::CompareCase::SENSITIVE)) { 762 base::CompareCase::SENSITIVE)) {
763 return true; 763 return true;
764 } 764 }
765 } 765 }
766 return false; 766 return false;
767 } 767 }
768 768
769 } // namespace autofill 769 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698