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

Side by Side Diff: chrome/browser/autofill/form_structure.cc

Issue 8169009: Remove FieldTypeSubGroups from the AutofillType class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests compile Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/autofill/form_structure.h" 5 #include "chrome/browser/autofill/form_structure.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 for (std::vector<AutofillField*>::iterator field = fields_->begin(); 925 for (std::vector<AutofillField*>::iterator field = fields_->begin();
926 field != fields_->end(); ++field) { 926 field != fields_->end(); ++field) {
927 const AutofillFieldType current_type = 927 const AutofillFieldType current_type =
928 AutofillType::GetEquivalentFieldType((*field)->type()); 928 AutofillType::GetEquivalentFieldType((*field)->type());
929 929
930 bool already_saw_current_type = seen_types.count(current_type) > 0; 930 bool already_saw_current_type = seen_types.count(current_type) > 0;
931 931
932 // Forms often ask for multiple phone numbers -- e.g. both a daytime and 932 // Forms often ask for multiple phone numbers -- e.g. both a daytime and
933 // evening phone number. Our phone number detection is also generally a 933 // evening phone number. Our phone number detection is also generally a
934 // little off. Hence, ignore this field type as a signal here. 934 // little off. Hence, ignore this field type as a signal here.
935 if (AutofillType(current_type).group() == AutofillType::PHONE_HOME) 935 if (AutofillType(current_type).group() == AutofillType::PHONE)
936 already_saw_current_type = false; 936 already_saw_current_type = false;
937 937
938 // Some forms have adjacent fields of the same type. Two common examples: 938 // Some forms have adjacent fields of the same type. Two common examples:
939 // * Forms with two email fields, where the second is meant to "confirm" 939 // * Forms with two email fields, where the second is meant to "confirm"
940 // the first. 940 // the first.
941 // * Forms with a <select> menu for states in some countries, and a 941 // * Forms with a <select> menu for states in some countries, and a
942 // freeform <input> field for states in other countries. (Usually, 942 // freeform <input> field for states in other countries. (Usually,
943 // only one of these two will be visible for any given choice of 943 // only one of these two will be visible for any given choice of
944 // country.) 944 // country.)
945 // Generally, adjacent fields of the same type belong in the same logical 945 // Generally, adjacent fields of the same type belong in the same logical
(...skipping 19 matching lines...) Expand all
965 for (std::vector<AutofillField*>::iterator field = fields_->begin(); 965 for (std::vector<AutofillField*>::iterator field = fields_->begin();
966 field != fields_->end(); ++field) { 966 field != fields_->end(); ++field) {
967 AutofillType::FieldTypeGroup field_type_group = 967 AutofillType::FieldTypeGroup field_type_group =
968 AutofillType((*field)->type()).group(); 968 AutofillType((*field)->type()).group();
969 if (field_type_group == AutofillType::CREDIT_CARD) 969 if (field_type_group == AutofillType::CREDIT_CARD)
970 (*field)->set_section((*field)->section() + ASCIIToUTF16("-cc")); 970 (*field)->set_section((*field)->section() + ASCIIToUTF16("-cc"));
971 else 971 else
972 (*field)->set_section((*field)->section() + ASCIIToUTF16("-default")); 972 (*field)->set_section((*field)->section() + ASCIIToUTF16("-default"));
973 } 973 }
974 } 974 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_type_unittest.cc ('k') | chrome/browser/autofill/phone_number.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698