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

Side by Side Diff: components/autofill/core/browser/form_field.cc

Issue 2022123002: Merge autofill::FormFieldData::is_checkable and is_checked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/core/browser/form_field.h" 5 #include "components/autofill/core/browser/form_field.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstddef> 8 #include <cstddef>
9 #include <iterator> 9 #include <iterator>
10 #include <memory> 10 #include <memory>
(...skipping 16 matching lines...) Expand all
27 27
28 namespace autofill { 28 namespace autofill {
29 namespace { 29 namespace {
30 30
31 bool ShouldBeProcessed(const AutofillField* field) { 31 bool ShouldBeProcessed(const AutofillField* field) {
32 // Ignore checkable fields as they interfere with parsers assuming context. 32 // Ignore checkable fields as they interfere with parsers assuming context.
33 // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1 33 // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1
34 // interferes with correctly understanding ADDRESS_LINE2. 34 // interferes with correctly understanding ADDRESS_LINE2.
35 // Ignore fields marked as presentational. See 35 // Ignore fields marked as presentational. See
36 // http://www.w3.org/TR/wai-aria/roles#presentation 36 // http://www.w3.org/TR/wai-aria/roles#presentation
37 return !(field->is_checkable || 37 return !(IsCheckable(field->check_status) ||
38 field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION); 38 field->role == FormFieldData::ROLE_ATTRIBUTE_PRESENTATION);
39 } 39 }
40 40
41 } // namespace 41 } // namespace
42 42
43 // There's an implicit precedence determined by the values assigned here. Email 43 // There's an implicit precedence determined by the values assigned here. Email
44 // is currently the most important followed by Phone, Address, Credit Card and 44 // is currently the most important followed by Phone, Address, Credit Card and
45 // finally Name. 45 // finally Name.
46 const float FormField::kBaseEmailParserScore = 1.4f; 46 const float FormField::kBaseEmailParserScore = 1.4f;
47 const float FormField::kBasePhoneParserScore = 1.3f; 47 const float FormField::kBasePhoneParserScore = 1.3f;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if ((match_type & MATCH_PASSWORD) && type == "password") 205 if ((match_type & MATCH_PASSWORD) && type == "password")
206 return true; 206 return true;
207 207
208 if ((match_type & MATCH_NUMBER) && type == "number") 208 if ((match_type & MATCH_NUMBER) && type == "number")
209 return true; 209 return true;
210 210
211 return false; 211 return false;
212 } 212 }
213 213
214 } // namespace autofill 214 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_metrics_unittest.cc ('k') | components/autofill/core/browser/form_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698