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

Side by Side Diff: components/autofill/renderer/form_autofill_util.cc

Issue 12721004: Autofill:Autocomplete: Enable autocheckout of input elements of type password. This will support fi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated expectations for hueristic tests Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « components/autofill/browser/form_structure_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/autofill/renderer/form_autofill_util.h" 5 #include "components/autofill/renderer/form_autofill_util.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 NOTREACHED(); 583 NOTREACHED();
584 return "UNKNOWN"; 584 return "UNKNOWN";
585 } 585 }
586 586
587 } // namespace 587 } // namespace
588 588
589 namespace autofill { 589 namespace autofill {
590 590
591 const size_t kMaxParseableFields = 100; 591 const size_t kMaxParseableFields = 100;
592 592
593 // In HTML5, all text fields except password are text input fields to 593 // All text fields, including password fields, should be extracted.
594 // autocomplete.
595 bool IsTextInput(const WebInputElement* element) { 594 bool IsTextInput(const WebInputElement* element) {
596 if (!element) 595 return element && element->isTextField();
597 return false;
598
599 return element->isTextField() && !element->isPasswordField();
600 } 596 }
601 597
602 bool IsSelectElement(const WebFormControlElement& element) { 598 bool IsSelectElement(const WebFormControlElement& element) {
603 // Is static for improving performance. 599 // Is static for improving performance.
604 CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one")); 600 CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one"));
605 return element.formControlType() == kSelectOne; 601 return element.formControlType() == kSelectOne;
606 } 602 }
607 603
608 bool IsCheckableElement(const WebInputElement* element) { 604 bool IsCheckableElement(const WebInputElement* element) {
609 if (!element) 605 if (!element)
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 continue; 1019 continue;
1024 1020
1025 if (input_element->isAutofilled()) 1021 if (input_element->isAutofilled())
1026 return true; 1022 return true;
1027 } 1023 }
1028 1024
1029 return false; 1025 return false;
1030 } 1026 }
1031 1027
1032 } // namespace autofill 1028 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/browser/form_structure_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698