diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 22:14:18 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 22:14:18 +0000 |
commit | 7127ca8f76464fbc40f578034254b0ce778a6dae (patch) | |
tree | 9bb797184c3a87445b34728c2dddf088fc461d03 /chrome/browser/autofill | |
parent | 77c93df6ab9299e0f28349966caf391f1d1d35e5 (diff) | |
download | chromium_src-7127ca8f76464fbc40f578034254b0ce778a6dae.zip chromium_src-7127ca8f76464fbc40f578034254b0ce778a6dae.tar.gz chromium_src-7127ca8f76464fbc40f578034254b0ce778a6dae.tar.bz2 |
autofill: Rename AutoFillFieldType to AutofillFieldType.
BUG=72758
TEST=compiled locally and trybots
Review URL: http://codereview.chromium.org/6592067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76442 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
31 files changed, 133 insertions, 133 deletions
diff --git a/chrome/browser/autofill/address.cc b/chrome/browser/autofill/address.cc index 1e79116..7a5a60e 100644 --- a/chrome/browser/autofill/address.cc +++ b/chrome/browser/autofill/address.cc @@ -103,7 +103,7 @@ void Address::FindInfoMatches(const AutoFillType& type, } string16 Address::GetFieldText(const AutoFillType& type) const { - AutoFillFieldType field_type = type.field_type(); + AutofillFieldType field_type = type.field_type(); if (field_type == ADDRESS_HOME_LINE1) return line1_; diff --git a/chrome/browser/autofill/address_field.cc b/chrome/browser/autofill/address_field.cc index 59f87b7..2e10bdb 100644 --- a/chrome/browser/autofill/address_field.cc +++ b/chrome/browser/autofill/address_field.cc @@ -14,13 +14,13 @@ #include "ui/base/l10n/l10n_util.h" bool AddressField::GetFieldInfo(FieldTypeMap* field_type_map) const { - AutoFillFieldType address_company; - AutoFillFieldType address_line1; - AutoFillFieldType address_line2; - AutoFillFieldType address_city; - AutoFillFieldType address_state; - AutoFillFieldType address_zip; - AutoFillFieldType address_country; + AutofillFieldType address_company; + AutofillFieldType address_line1; + AutofillFieldType address_line2; + AutofillFieldType address_city; + AutofillFieldType address_state; + AutofillFieldType address_zip; + AutofillFieldType address_country; switch (type_) { case kShippingAddress: diff --git a/chrome/browser/autofill/autofill_common_test.cc b/chrome/browser/autofill/autofill_common_test.cc index 2e3af51..5dea527 100644 --- a/chrome/browser/autofill/autofill_common_test.cc +++ b/chrome/browser/autofill/autofill_common_test.cc @@ -26,7 +26,7 @@ void CreateTestFormField(const char* label, } inline void check_and_set( - FormGroup* profile, AutoFillFieldType type, const char* value) { + FormGroup* profile, AutofillFieldType type, const char* value) { if (value) profile->SetInfo(AutoFillType(type), ASCIIToUTF16(value)); } diff --git a/chrome/browser/autofill/autofill_field.cc b/chrome/browser/autofill/autofill_field.cc index 74a6368..9f4b2d9 100644 --- a/chrome/browser/autofill/autofill_field.cc +++ b/chrome/browser/autofill/autofill_field.cc @@ -40,7 +40,7 @@ AutoFillField::AutoFillField(const webkit_glue::FormField& field, AutoFillField::~AutoFillField() {} -void AutoFillField::set_heuristic_type(const AutoFillFieldType& type) { +void AutoFillField::set_heuristic_type(const AutofillFieldType& type) { if (type >= 0 && type < MAX_VALID_FIELD_TYPE) { heuristic_type_ = type; } else { @@ -51,7 +51,7 @@ void AutoFillField::set_heuristic_type(const AutoFillFieldType& type) { } } -AutoFillFieldType AutoFillField::type() const { +AutofillFieldType AutoFillField::type() const { if (server_type_ != NO_SERVER_DATA) return server_type_; diff --git a/chrome/browser/autofill/autofill_field.h b/chrome/browser/autofill/autofill_field.h index 3e749f8..b72313a 100644 --- a/chrome/browser/autofill/autofill_field.h +++ b/chrome/browser/autofill/autofill_field.h @@ -21,20 +21,20 @@ class AutoFillField : public webkit_glue::FormField { const string16& unique_name() const { return unique_name_; } - AutoFillFieldType heuristic_type() const { return heuristic_type_; } - AutoFillFieldType server_type() const { return server_type_; } + AutofillFieldType heuristic_type() const { return heuristic_type_; } + AutofillFieldType server_type() const { return server_type_; } const FieldTypeSet& possible_types() const { return possible_types_; } // Sets the heuristic type of this field, validating the input. - void set_heuristic_type(const AutoFillFieldType& type); - void set_server_type(const AutoFillFieldType& type) { server_type_ = type; } + void set_heuristic_type(const AutofillFieldType& type); + void set_server_type(const AutofillFieldType& type) { server_type_ = type; } void set_possible_types(const FieldTypeSet& possible_types) { possible_types_ = possible_types; } // This function automatically chooses between server and heuristic autofill // type, depending on the data available. - AutoFillFieldType type() const; + AutofillFieldType type() const; // Returns true if the value of this field is empty. bool IsEmpty() const; @@ -52,10 +52,10 @@ class AutoFillField : public webkit_glue::FormField { string16 unique_name_; // The type of the field, as determined by the AutoFill server. - AutoFillFieldType server_type_; + AutofillFieldType server_type_; // The type of the field, as determined by the local heuristics. - AutoFillFieldType heuristic_type_; + AutofillFieldType heuristic_type_; // The set of possible types for this field. FieldTypeSet possible_types_; diff --git a/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc b/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc index 3519de1..6bd1c06 100644 --- a/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc +++ b/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc @@ -78,7 +78,7 @@ string16 ReadAndDecryptValue(RegKey* key, const wchar_t* value_name) { } struct { - AutoFillFieldType field_type; + AutofillFieldType field_type; const wchar_t *reg_value_name; } profile_reg_values[] = { { NAME_FIRST, L"name_first" }, @@ -113,7 +113,7 @@ struct { // We do not import verification code. }; -typedef std::map<std::wstring, AutoFillFieldType> RegToFieldMap; +typedef std::map<std::wstring, AutofillFieldType> RegToFieldMap; bool ImportSingleProfile(FormGroup* profile, RegKey* key, diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 7201c4f..0633e46 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -105,11 +105,11 @@ void FindSectionBounds(const FormStructure& form, *section_start = 0; *section_end = form.field_count(); - std::set<AutoFillFieldType> seen_types; + std::set<AutofillFieldType> seen_types; bool initiating_field_is_in_current_section = false; for (size_t i = 0; i < form.field_count(); ++i) { const AutoFillField* current_field = form.field(i); - const AutoFillFieldType current_type = + const AutofillFieldType current_type = AutoFillType::GetEquivalentFieldType(current_field->type()); // Fields of unknown type don't help us to distinguish sections. @@ -624,8 +624,8 @@ void AutoFillManager::LogMetricsAboutSubmittedForm( metric_logger_->Log(AutofillMetrics::FIELD_AUTOFILL_FAILED, experiment_id); - AutoFillFieldType heuristic_type = UNKNOWN_TYPE; - AutoFillFieldType server_type = NO_SERVER_DATA; + AutofillFieldType heuristic_type = UNKNOWN_TYPE; + AutofillFieldType server_type = NO_SERVER_DATA; std::map<std::string, const AutoFillField*>::const_iterator cached_field = cached_fields.find(field->FieldSignature()); if (cached_field != cached_fields.end()) { @@ -824,7 +824,7 @@ void AutoFillManager::GetProfileSuggestions(FormStructure* form, } } - std::vector<AutoFillFieldType> form_fields; + std::vector<AutofillFieldType> form_fields; form_fields.reserve(form->field_count()); for (std::vector<AutoFillField*>::const_iterator iter = form->begin(); iter != form->end(); ++iter) { diff --git a/chrome/browser/autofill/autofill_merge_unittest.cc b/chrome/browser/autofill/autofill_merge_unittest.cc index a1548a0..fd97e17 100644 --- a/chrome/browser/autofill/autofill_merge_unittest.cc +++ b/chrome/browser/autofill/autofill_merge_unittest.cc @@ -27,7 +27,7 @@ const char kFieldSeparator[] = ": "; const char kProfileSeparator[] = "---"; const size_t kFieldOffset = arraysize(kFieldSeparator) - 1; -const AutoFillFieldType kProfileFieldTypes[] = { +const AutofillFieldType kProfileFieldTypes[] = { NAME_FIRST, NAME_MIDDLE, NAME_LAST, @@ -50,7 +50,7 @@ std::string SerializeProfiles(const std::vector<AutoFillProfile*>& profiles) { result += kProfileSeparator; result += "\n"; for (size_t j = 0; j < arraysize(kProfileFieldTypes); ++j) { - AutoFillFieldType type = kProfileFieldTypes[j]; + AutofillFieldType type = kProfileFieldTypes[j]; result += AutoFillType::FieldTypeToString(type); result += kFieldSeparator; result += UTF16ToUTF8(profiles[i]->GetFieldText(AutoFillType(type))); @@ -197,7 +197,7 @@ void AutoFillMergeTest::MergeProfiles(const std::string& profiles, // into the field's name. AutoFillField* field = const_cast<AutoFillField*>(form_structure.field(i)); - AutoFillFieldType type = + AutofillFieldType type = AutoFillType::StringToFieldType(UTF16ToUTF8(field->name())); field->set_heuristic_type(type); } diff --git a/chrome/browser/autofill/autofill_metrics_unittest.cc b/chrome/browser/autofill/autofill_metrics_unittest.cc index f3d9d99..e793c7b 100644 --- a/chrome/browser/autofill/autofill_metrics_unittest.cc +++ b/chrome/browser/autofill/autofill_metrics_unittest.cc @@ -158,8 +158,8 @@ class TestFormStructure : public FormStructure { explicit TestFormStructure(const FormData& form) : FormStructure(form) {} virtual ~TestFormStructure() {} - void SetFieldTypes(const std::vector<AutoFillFieldType>& heuristic_types, - const std::vector<AutoFillFieldType>& server_types) { + void SetFieldTypes(const std::vector<AutofillFieldType>& heuristic_types, + const std::vector<AutofillFieldType>& server_types) { ASSERT_EQ(field_count(), heuristic_types.size()); ASSERT_EQ(field_count(), server_types.size()); @@ -283,8 +283,8 @@ TEST_F(AutofillMetricsTest, QualityMetricsForFailure) { const char* label; const char* name; const char* value; - AutoFillFieldType heuristic_type; - AutoFillFieldType server_type; + AutofillFieldType heuristic_type; + AutofillFieldType server_type; AutofillMetrics::QualityMetric heuristic_metric; AutofillMetrics::QualityMetric server_metric; } failure_cases[] = { @@ -344,7 +344,7 @@ TEST_F(AutofillMetricsTest, QualityMetricsForFailure) { } }; - std::vector<AutoFillFieldType> heuristic_types, server_types; + std::vector<AutofillFieldType> heuristic_types, server_types; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(failure_cases); ++i) { FormField field; autofill_test::CreateTestFormField(failure_cases[i].label, @@ -390,7 +390,7 @@ TEST_F(AutofillMetricsTest, SaneMetricsWithCacheMismatch) { form.action = GURL("http://example.com/submit.html"); form.user_submitted = true; - std::vector<AutoFillFieldType> heuristic_types, server_types; + std::vector<AutofillFieldType> heuristic_types, server_types; FormField field; autofill_test::CreateTestFormField( diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc index 448247d..13d2b04 100644 --- a/chrome/browser/autofill/autofill_profile.cc +++ b/chrome/browser/autofill/autofill_profile.cc @@ -30,8 +30,8 @@ void InitPersonalInfo(FormGroupMap* personal_info) { // Like |AutoFillType::GetEquivalentFieldType()|, but also returns |NAME_FULL| // for first, middle, and last name field types. -AutoFillFieldType GetEquivalentFieldTypeCollapsingNames( - AutoFillFieldType field_type) { +AutofillFieldType GetEquivalentFieldTypeCollapsingNames( + AutofillFieldType field_type) { if (field_type == NAME_FIRST || field_type == NAME_MIDDLE || field_type == NAME_LAST) return NAME_FULL; @@ -47,10 +47,10 @@ AutoFillFieldType GetEquivalentFieldTypeCollapsingNames( // |UNKNOWN_TYPE| by convention. The resulting list of fields is sorted in // decreasing order of importance. void GetFieldsForDistinguishingProfiles( - const std::vector<AutoFillFieldType>* suggested_fields, - AutoFillFieldType excluded_field, - std::vector<AutoFillFieldType>* distinguishing_fields) { - static const AutoFillFieldType kDefaultDistinguishingFields[] = { + const std::vector<AutofillFieldType>* suggested_fields, + AutofillFieldType excluded_field, + std::vector<AutofillFieldType>* distinguishing_fields) { + static const AutofillFieldType kDefaultDistinguishingFields[] = { NAME_FULL, ADDRESS_HOME_LINE1, ADDRESS_HOME_CITY, @@ -73,15 +73,15 @@ void GetFieldsForDistinguishingProfiles( // Keep track of which fields we've seen so that we avoid duplicate entries. // Always ignore fields of unknown type and the excluded field. - std::set<AutoFillFieldType> seen_fields; + std::set<AutofillFieldType> seen_fields; seen_fields.insert(UNKNOWN_TYPE); seen_fields.insert(GetEquivalentFieldTypeCollapsingNames(excluded_field)); distinguishing_fields->clear(); - for (std::vector<AutoFillFieldType>::const_iterator it = + for (std::vector<AutofillFieldType>::const_iterator it = suggested_fields->begin(); it != suggested_fields->end(); ++it) { - AutoFillFieldType suggested_type = + AutofillFieldType suggested_type = GetEquivalentFieldTypeCollapsingNames(*it); if (seen_fields.insert(suggested_type).second) distinguishing_fields->push_back(suggested_type); @@ -93,7 +93,7 @@ void GetFieldsForDistinguishingProfiles( // distinguish between profiles that are identical except for the name. if (excluded_field != NAME_FULL && GetEquivalentFieldTypeCollapsingNames(excluded_field) == NAME_FULL) { - for (std::vector<AutoFillFieldType>::const_iterator it = + for (std::vector<AutofillFieldType>::const_iterator it = suggested_fields->begin(); it != suggested_fields->end(); ++it) { if (*it != excluded_field && @@ -239,14 +239,14 @@ bool AutoFillProfile::AdjustInferredLabels( // static void AutoFillProfile::CreateInferredLabels( const std::vector<AutoFillProfile*>* profiles, - const std::vector<AutoFillFieldType>* suggested_fields, - AutoFillFieldType excluded_field, + const std::vector<AutofillFieldType>* suggested_fields, + AutofillFieldType excluded_field, size_t minimal_fields_shown, std::vector<string16>* created_labels) { DCHECK(profiles); DCHECK(created_labels); - std::vector<AutoFillFieldType> fields_to_use; + std::vector<AutofillFieldType> fields_to_use; GetFieldsForDistinguishingProfiles(suggested_fields, excluded_field, &fields_to_use); @@ -307,7 +307,7 @@ void AutoFillProfile::operator=(const AutoFillProfile& source) { int AutoFillProfile::Compare(const AutoFillProfile& profile) const { // The following AutoFill field types are the only types we store in the WebDB // so far, so we're only concerned with matching these types in the profile. - const AutoFillFieldType types[] = { NAME_FIRST, + const AutofillFieldType types[] = { NAME_FIRST, NAME_MIDDLE, NAME_LAST, EMAIL_ADDRESS, @@ -350,14 +350,14 @@ const string16 AutoFillProfile::PrimaryValue() const { } string16 AutoFillProfile::ConstructInferredLabel( - const std::vector<AutoFillFieldType>& included_fields, + const std::vector<AutofillFieldType>& included_fields, size_t num_fields_to_use) const { const string16 separator = l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_ADDRESS_SUMMARY_SEPARATOR); string16 label; size_t num_fields_used = 0; - for (std::vector<AutoFillFieldType>::const_iterator it = + for (std::vector<AutofillFieldType>::const_iterator it = included_fields.begin(); it != included_fields.end() && num_fields_used < num_fields_to_use; ++it) { @@ -383,14 +383,14 @@ string16 AutoFillProfile::ConstructInferredLabel( void AutoFillProfile::CreateDifferentiatingLabels( const std::vector<AutoFillProfile*>& profiles, const std::list<size_t>& indices, - const std::vector<AutoFillFieldType>& fields, + const std::vector<AutofillFieldType>& fields, size_t num_fields_to_include, std::vector<string16>* created_labels) { // For efficiency, we first construct a map of fields to their text values and // each value's frequency. - std::map<AutoFillFieldType, + std::map<AutofillFieldType, std::map<string16, size_t> > field_text_frequencies_by_field; - for (std::vector<AutoFillFieldType>::const_iterator field = fields.begin(); + for (std::vector<AutofillFieldType>::const_iterator field = fields.begin(); field != fields.end(); ++field) { std::map<string16, size_t>& field_text_frequencies = field_text_frequencies_by_field[*field]; @@ -420,9 +420,9 @@ void AutoFillProfile::CreateDifferentiatingLabels( it != indices.end(); ++it) { const AutoFillProfile* profile = profiles[*it]; - std::vector<AutoFillFieldType> label_fields; + std::vector<AutofillFieldType> label_fields; bool found_differentiating_field = false; - for (std::vector<AutoFillFieldType>::const_iterator field = fields.begin(); + for (std::vector<AutofillFieldType>::const_iterator field = fields.begin(); field != fields.end(); ++field) { // Skip over empty fields. string16 field_text = profile->GetFieldText(AutoFillType(*field)); diff --git a/chrome/browser/autofill/autofill_profile.h b/chrome/browser/autofill/autofill_profile.h index 5d77ed8..d7c6d0b 100644 --- a/chrome/browser/autofill/autofill_profile.h +++ b/chrome/browser/autofill/autofill_profile.h @@ -80,8 +80,8 @@ class AutoFillProfile : public FormGroup { // least |minimal_fields_shown| fields, if possible. static void CreateInferredLabels( const std::vector<AutoFillProfile*>* profiles, - const std::vector<AutoFillFieldType>* suggested_fields, - AutoFillFieldType excluded_field, + const std::vector<AutofillFieldType>* suggested_fields, + AutofillFieldType excluded_field, size_t minimal_fields_shown, std::vector<string16>* created_labels); @@ -116,7 +116,7 @@ class AutoFillProfile : public FormGroup { // fields in |label_fields|. Uses as many fields as possible if there are not // enough non-empty fields. string16 ConstructInferredLabel( - const std::vector<AutoFillFieldType>& label_fields, + const std::vector<AutofillFieldType>& label_fields, size_t num_fields_to_include) const; // Creates inferred labels for |profiles| at indices corresponding to @@ -127,7 +127,7 @@ class AutoFillProfile : public FormGroup { static void CreateDifferentiatingLabels( const std::vector<AutoFillProfile*>& profiles, const std::list<size_t>& indices, - const std::vector<AutoFillFieldType>& fields, + const std::vector<AutofillFieldType>& fields, size_t num_fields_to_include, std::vector<string16>* created_labels); diff --git a/chrome/browser/autofill/autofill_profile_unittest.cc b/chrome/browser/autofill/autofill_profile_unittest.cc index ab4a853..1792429 100644 --- a/chrome/browser/autofill/autofill_profile_unittest.cc +++ b/chrome/browser/autofill/autofill_profile_unittest.cc @@ -339,7 +339,7 @@ TEST(AutoFillProfileTest, CreateInferredLabels) { EXPECT_EQ(ASCIIToUTF16("Jane Doe, 123 Letha Shore., Dis"), labels[1]); - std::vector<AutoFillFieldType> suggested_fields; + std::vector<AutofillFieldType> suggested_fields; suggested_fields.push_back(ADDRESS_HOME_CITY); suggested_fields.push_back(ADDRESS_HOME_STATE); suggested_fields.push_back(ADDRESS_HOME_ZIP); @@ -409,7 +409,7 @@ TEST(AutoFillProfileTest, CreateInferredLabelsFallsBackToFullName) { // If the only name field in the suggested fields is the excluded field, we // should not fall back to the full name as a distinguishing field. - std::vector<AutoFillFieldType> suggested_fields; + std::vector<AutofillFieldType> suggested_fields; suggested_fields.push_back(NAME_LAST); suggested_fields.push_back(ADDRESS_HOME_LINE1); suggested_fields.push_back(EMAIL_ADDRESS); @@ -443,7 +443,7 @@ TEST(AutoFillProfileTest, CreateInferredLabelsNoDuplicatedFields) { // If the only name field in the suggested fields is the excluded field, we // should not fall back to the full name as a distinguishing field. - std::vector<AutoFillFieldType> suggested_fields; + std::vector<AutofillFieldType> suggested_fields; suggested_fields.push_back(ADDRESS_HOME_LINE1); suggested_fields.push_back(ADDRESS_BILLING_LINE1); suggested_fields.push_back(EMAIL_ADDRESS); diff --git a/chrome/browser/autofill/autofill_type.cc b/chrome/browser/autofill/autofill_type.cc index 69485aa..56ae9dd 100644 --- a/chrome/browser/autofill/autofill_type.cc +++ b/chrome/browser/autofill/autofill_type.cc @@ -137,7 +137,7 @@ AutoFillType::AutoFillTypeDefinition kAutoFillTypeDefinitions[] = { } // namespace -AutoFillType::AutoFillType(AutoFillFieldType field_type) { +AutoFillType::AutoFillType(AutofillFieldType field_type) { if ((field_type < NO_SERVER_DATA || field_type >= MAX_VALID_FIELD_TYPE) || (field_type >= 15 && field_type <= 19) || (field_type >= 25 && field_type <= 29) || @@ -157,7 +157,7 @@ AutoFillType& AutoFillType::operator=(const AutoFillType& autofill_type) { return *this; } -AutoFillFieldType AutoFillType::field_type() const { +AutofillFieldType AutoFillType::field_type() const { return field_type_; } @@ -170,8 +170,8 @@ FieldTypeSubGroup AutoFillType::subgroup() const { } // static -AutoFillFieldType AutoFillType::GetEquivalentFieldType( - AutoFillFieldType field_type) { +AutofillFieldType AutoFillType::GetEquivalentFieldType( + AutofillFieldType field_type) { // When billing information is requested from the profile we map to the // home address equivalents. switch (field_type) { @@ -202,7 +202,7 @@ AutoFillFieldType AutoFillType::GetEquivalentFieldType( } // static -std::string AutoFillType::FieldTypeToString(AutoFillFieldType type) { +std::string AutoFillType::FieldTypeToString(AutofillFieldType type) { switch (type) { case NO_SERVER_DATA: return "NO_SERVER_DATA"; @@ -293,13 +293,13 @@ std::string AutoFillType::FieldTypeToString(AutoFillFieldType type) { case COMPANY_NAME: return "COMPANY_NAME"; default: - NOTREACHED() << "Invalid AutoFillFieldType value."; + NOTREACHED() << "Invalid AutofillFieldType value."; } return std::string(); } // static -AutoFillFieldType AutoFillType::StringToFieldType(const std::string& str) { +AutofillFieldType AutoFillType::StringToFieldType(const std::string& str) { if (str == "NO_SERVER_DATA") return NO_SERVER_DATA; if (str == "UNKNOWN_TYPE") @@ -389,6 +389,6 @@ AutoFillFieldType AutoFillType::StringToFieldType(const std::string& str) { if (str == "COMPANY_NAME") return COMPANY_NAME; - NOTREACHED() << "Unknown AutoFillFieldType " << str; + NOTREACHED() << "Unknown AutofillFieldType " << str; return UNKNOWN_TYPE; } diff --git a/chrome/browser/autofill/autofill_type.h b/chrome/browser/autofill/autofill_type.h index a7861af..e634f7e 100644 --- a/chrome/browser/autofill/autofill_type.h +++ b/chrome/browser/autofill/autofill_type.h @@ -51,30 +51,30 @@ class AutoFillType { FieldTypeSubGroup subgroup; }; - explicit AutoFillType(AutoFillFieldType field_type); + explicit AutoFillType(AutofillFieldType field_type); AutoFillType(const AutoFillType& autofill_type); AutoFillType& operator=(const AutoFillType& autofill_type); - AutoFillFieldType field_type() const; + AutofillFieldType field_type() const; FieldTypeGroup group() const; FieldTypeSubGroup subgroup() const; // Maps |field_type| to a field type that can be directly stored in a profile // (in the sense that it makes sense to call |AutoFillProfile::SetInfo()| with // the returned field type as the first parameter). - static AutoFillFieldType GetEquivalentFieldType(AutoFillFieldType field_type); + static AutofillFieldType GetEquivalentFieldType(AutofillFieldType field_type); - // Utilities for serializing and deserializing an |AutoFillFieldType|. - static std::string FieldTypeToString(AutoFillFieldType field_type); - static AutoFillFieldType StringToFieldType(const std::string& str); + // Utilities for serializing and deserializing an |AutofillFieldType|. + static std::string FieldTypeToString(AutofillFieldType field_type); + static AutofillFieldType StringToFieldType(const std::string& str); private: - AutoFillFieldType field_type_; + AutofillFieldType field_type_; }; typedef AutoFillType::FieldTypeGroup FieldTypeGroup; typedef AutoFillType::FieldTypeSubGroup FieldTypeSubGroup; -typedef std::set<AutoFillFieldType> FieldTypeSet; -typedef std::map<string16, AutoFillFieldType> FieldTypeMap; +typedef std::set<AutofillFieldType> FieldTypeSet; +typedef std::map<string16, AutofillFieldType> FieldTypeMap; #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_TYPE_H_ diff --git a/chrome/browser/autofill/autofill_type_unittest.cc b/chrome/browser/autofill/autofill_type_unittest.cc index d610717..d764eed 100644 --- a/chrome/browser/autofill/autofill_type_unittest.cc +++ b/chrome/browser/autofill/autofill_type_unittest.cc @@ -45,13 +45,13 @@ TEST(AutoFillTypeTest, Basic) { EXPECT_EQ(AutoFillType::NO_SUBGROUP, boundary.subgroup()); // Beyond the boundary (error) condition. - AutoFillType beyond(static_cast<AutoFillFieldType>(MAX_VALID_FIELD_TYPE+10)); + AutoFillType beyond(static_cast<AutofillFieldType>(MAX_VALID_FIELD_TYPE+10)); EXPECT_EQ(UNKNOWN_TYPE, beyond.field_type()); EXPECT_EQ(AutoFillType::NO_GROUP, beyond.group()); EXPECT_EQ(AutoFillType::NO_SUBGROUP, beyond.subgroup()); // In-between value. Missing from enum but within range. Error condition. - AutoFillType between(static_cast<AutoFillFieldType>(16)); + AutoFillType between(static_cast<AutofillFieldType>(16)); EXPECT_EQ(UNKNOWN_TYPE, between.field_type()); EXPECT_EQ(AutoFillType::NO_GROUP, between.group()); EXPECT_EQ(AutoFillType::NO_SUBGROUP, between.subgroup()); diff --git a/chrome/browser/autofill/autofill_xml_parser.cc b/chrome/browser/autofill/autofill_xml_parser.cc index decbee4..86520e9 100644 --- a/chrome/browser/autofill/autofill_xml_parser.cc +++ b/chrome/browser/autofill/autofill_xml_parser.cc @@ -25,7 +25,7 @@ void AutoFillXmlParser::Error(buzz::XmlParseContext* context, } AutoFillQueryXmlParser::AutoFillQueryXmlParser( - std::vector<AutoFillFieldType>* field_types, + std::vector<AutofillFieldType>* field_types, UploadRequired* upload_required, std::string* experiment_id) : field_types_(field_types), @@ -72,13 +72,13 @@ void AutoFillQueryXmlParser::StartElement(buzz::XmlParseContext* context, // Determine the field type from the attribute value. There should be one // attribute (autofilltype) with an integer value. - AutoFillFieldType field_type = UNKNOWN_TYPE; + AutofillFieldType field_type = UNKNOWN_TYPE; buzz::QName attribute_qname = context->ResolveQName(attrs[0], true); const std::string& attribute_name = attribute_qname.LocalPart(); if (attribute_name.compare("autofilltype") == 0) { int value = GetIntValue(context, attrs[1]); - field_type = static_cast<AutoFillFieldType>(value); + field_type = static_cast<AutofillFieldType>(value); if (field_type < 0 || field_type > MAX_VALID_FIELD_TYPE) { field_type = NO_SERVER_DATA; } diff --git a/chrome/browser/autofill/autofill_xml_parser.h b/chrome/browser/autofill/autofill_xml_parser.h index 5afe03a..05d5554 100644 --- a/chrome/browser/autofill/autofill_xml_parser.h +++ b/chrome/browser/autofill/autofill_xml_parser.h @@ -64,7 +64,7 @@ class AutoFillXmlParser : public buzz::XmlParseHandler { // unknown, other types are documented in chrome/browser/autofill/field_types.h. class AutoFillQueryXmlParser : public AutoFillXmlParser { public: - AutoFillQueryXmlParser(std::vector<AutoFillFieldType>* field_types, + AutoFillQueryXmlParser(std::vector<AutofillFieldType>* field_types, UploadRequired* upload_required, std::string* experiment_id); @@ -83,7 +83,7 @@ class AutoFillQueryXmlParser : public AutoFillXmlParser { int GetIntValue(buzz::XmlParseContext* context, const char* attribute); // The parsed field types. - std::vector<AutoFillFieldType>* field_types_; + std::vector<AutofillFieldType>* field_types_; // A flag indicating whether the client should upload AutoFill data when this // form is submitted. diff --git a/chrome/browser/autofill/autofill_xml_parser_unittest.cc b/chrome/browser/autofill/autofill_xml_parser_unittest.cc index 11d1ee6..5f5146c 100644 --- a/chrome/browser/autofill/autofill_xml_parser_unittest.cc +++ b/chrome/browser/autofill/autofill_xml_parser_unittest.cc @@ -21,8 +21,8 @@ TEST(AutoFillQueryXmlParserTest, BasicQuery) { "<field autofilltype=\"2\" />" "</autofillqueryresponse>"; - // Create a vector of AutoFillFieldTypes, to assign the parsed field types to. - std::vector<AutoFillFieldType> field_types; + // Create a vector of AutofillFieldTypes, to assign the parsed field types to. + std::vector<AutofillFieldType> field_types; UploadRequired upload_required = USE_UPLOAD_RATES; std::string experiment_id; @@ -43,7 +43,7 @@ TEST(AutoFillQueryXmlParserTest, BasicQuery) { // Test parsing the upload required attribute. TEST(AutoFillQueryXmlParserTest, TestUploadRequired) { - std::vector<AutoFillFieldType> field_types; + std::vector<AutofillFieldType> field_types; UploadRequired upload_required = USE_UPLOAD_RATES; std::string experiment_id; @@ -95,7 +95,7 @@ TEST(AutoFillQueryXmlParserTest, TestUploadRequired) { // Test parsing the experiment id attribute TEST(AutoFillQueryXmlParserTest, ParseExperimentId) { - std::vector<AutoFillFieldType> field_types; + std::vector<AutofillFieldType> field_types; UploadRequired upload_required = USE_UPLOAD_RATES; std::string experiment_id; @@ -155,7 +155,7 @@ TEST(AutoFillQueryXmlParserTest, ParseExperimentId) { // Test badly formed XML queries. TEST(AutoFillQueryXmlParserTest, ParseErrors) { - std::vector<AutoFillFieldType> field_types; + std::vector<AutofillFieldType> field_types; UploadRequired upload_required = USE_UPLOAD_RATES; std::string experiment_id; diff --git a/chrome/browser/autofill/contact_info.cc b/chrome/browser/autofill/contact_info.cc index 6b6b6ea..0beb1e3 100644 --- a/chrome/browser/autofill/contact_info.cc +++ b/chrome/browser/autofill/contact_info.cc @@ -12,7 +12,7 @@ static const string16 kNameSplitChars = ASCIIToUTF16("-'. "); -static const AutoFillFieldType kAutoFillContactInfoTypes[] = { +static const AutofillFieldType kAutoFillContactInfoTypes[] = { NAME_FIRST, NAME_MIDDLE, NAME_LAST, @@ -105,7 +105,7 @@ void ContactInfo::FindInfoMatches(const AutoFillType& type, } string16 ContactInfo::GetFieldText(const AutoFillType& type) const { - AutoFillFieldType field_type = type.field_type(); + AutofillFieldType field_type = type.field_type(); if (field_type == NAME_FIRST) return first(); @@ -134,7 +134,7 @@ string16 ContactInfo::GetFieldText(const AutoFillType& type) const { } void ContactInfo::SetInfo(const AutoFillType& type, const string16& value) { - AutoFillFieldType field_type = type.field_type(); + AutofillFieldType field_type = type.field_type(); DCHECK_EQ(AutoFillType::CONTACT_INFO, type.group()); if (field_type == NAME_FIRST) SetFirst(value); @@ -196,7 +196,7 @@ string16 ContactInfo::MiddleInitial() const { return initial; } -bool ContactInfo::FindInfoMatchesHelper(const AutoFillFieldType& field_type, +bool ContactInfo::FindInfoMatchesHelper(const AutofillFieldType& field_type, const string16& info, string16* match) const { if (match == NULL) { diff --git a/chrome/browser/autofill/contact_info.h b/chrome/browser/autofill/contact_info.h index d47ec8d..98692ac 100644 --- a/chrome/browser/autofill/contact_info.h +++ b/chrome/browser/autofill/contact_info.h @@ -52,7 +52,7 @@ class ContactInfo : public FormGroup { // A helper function for FindInfoMatches that only handles matching the info // with the requested field type. - bool FindInfoMatchesHelper(const AutoFillFieldType& field_type, + bool FindInfoMatchesHelper(const AutofillFieldType& field_type, const string16& info, string16* matched_text) const; diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc index 20fca4e..3daf323 100644 --- a/chrome/browser/autofill/credit_card.cc +++ b/chrome/browser/autofill/credit_card.cc @@ -24,7 +24,7 @@ namespace { const char* kCreditCardObfuscationString = "************"; -const AutoFillFieldType kAutoFillCreditCardTypes[] = { +const AutofillFieldType kAutoFillCreditCardTypes[] = { CREDIT_CARD_NAME, CREDIT_CARD_NUMBER, CREDIT_CARD_TYPE, @@ -407,7 +407,7 @@ int CreditCard::Compare(const CreditCard& credit_card) const { // The following CreditCard field types are the only types we store in the // WebDB so far, so we're only concerned with matching these types in the // credit card. - const AutoFillFieldType types[] = { CREDIT_CARD_NAME, + const AutofillFieldType types[] = { CREDIT_CARD_NAME, CREDIT_CARD_NUMBER, CREDIT_CARD_EXP_MONTH, CREDIT_CARD_EXP_4_DIGIT_YEAR }; @@ -529,7 +529,7 @@ void CreditCard::set_expiration_year(int expiration_year) { expiration_year_ = expiration_year; } -bool CreditCard::FindInfoMatchesHelper(const AutoFillFieldType& field_type, +bool CreditCard::FindInfoMatchesHelper(const AutofillFieldType& field_type, const string16& info, string16* match) const { DCHECK(match); diff --git a/chrome/browser/autofill/credit_card.h b/chrome/browser/autofill/credit_card.h index e7368e4..3b3a99b 100644 --- a/chrome/browser/autofill/credit_card.h +++ b/chrome/browser/autofill/credit_card.h @@ -110,7 +110,7 @@ class CreditCard : public FormGroup { // A helper function for FindInfoMatches that only handles matching the info // with the requested field type. - bool FindInfoMatchesHelper(const AutoFillFieldType& field_type, + bool FindInfoMatchesHelper(const AutofillFieldType& field_type, const string16& info, string16* match) const; diff --git a/chrome/browser/autofill/fax_number.cc b/chrome/browser/autofill/fax_number.cc index 06dd781..d1ea3d2 100644 --- a/chrome/browser/autofill/fax_number.cc +++ b/chrome/browser/autofill/fax_number.cc @@ -12,22 +12,22 @@ FormGroup* FaxNumber::Clone() const { return new FaxNumber(*this); } -AutoFillFieldType FaxNumber::GetNumberType() const { +AutofillFieldType FaxNumber::GetNumberType() const { return PHONE_FAX_NUMBER; } -AutoFillFieldType FaxNumber::GetCityCodeType() const { +AutofillFieldType FaxNumber::GetCityCodeType() const { return PHONE_FAX_CITY_CODE; } -AutoFillFieldType FaxNumber::GetCountryCodeType() const { +AutofillFieldType FaxNumber::GetCountryCodeType() const { return PHONE_FAX_COUNTRY_CODE; } -AutoFillFieldType FaxNumber::GetCityAndNumberType() const { +AutofillFieldType FaxNumber::GetCityAndNumberType() const { return PHONE_FAX_CITY_AND_NUMBER; } -AutoFillFieldType FaxNumber::GetWholeNumberType() const { +AutofillFieldType FaxNumber::GetWholeNumberType() const { return PHONE_FAX_WHOLE_NUMBER; } diff --git a/chrome/browser/autofill/fax_number.h b/chrome/browser/autofill/fax_number.h index 7fe9a1c..75d6575 100644 --- a/chrome/browser/autofill/fax_number.h +++ b/chrome/browser/autofill/fax_number.h @@ -18,11 +18,11 @@ class FaxNumber : public PhoneNumber { virtual FormGroup* Clone() const; protected: - virtual AutoFillFieldType GetNumberType() const; - virtual AutoFillFieldType GetCityCodeType() const; - virtual AutoFillFieldType GetCountryCodeType() const; - virtual AutoFillFieldType GetCityAndNumberType() const; - virtual AutoFillFieldType GetWholeNumberType() const; + virtual AutofillFieldType GetNumberType() const; + virtual AutofillFieldType GetCityCodeType() const; + virtual AutofillFieldType GetCountryCodeType() const; + virtual AutofillFieldType GetCityAndNumberType() const; + virtual AutofillFieldType GetWholeNumberType() const; private: explicit FaxNumber(const FaxNumber& phone) : PhoneNumber(phone) {} diff --git a/chrome/browser/autofill/field_types.h b/chrome/browser/autofill/field_types.h index ab03192a..9d76e8b 100644 --- a/chrome/browser/autofill/field_types.h +++ b/chrome/browser/autofill/field_types.h @@ -85,8 +85,8 @@ typedef enum _FieldType { // No new types can be added. MAX_VALID_FIELD_TYPE = 61, -} AutoFillFieldType; +} AutofillFieldType; -typedef std::set<AutoFillFieldType> FieldTypeSet; +typedef std::set<AutofillFieldType> FieldTypeSet; #endif // CHROME_BROWSER_AUTOFILL_FIELD_TYPES_H_ diff --git a/chrome/browser/autofill/form_group.h b/chrome/browser/autofill/form_group.h index b1b2243..dd40fcd 100644 --- a/chrome/browser/autofill/form_group.h +++ b/chrome/browser/autofill/form_group.h @@ -29,7 +29,7 @@ class FormGroup { virtual void GetPossibleFieldTypes(const string16& text, FieldTypeSet* possible_types) const = 0; - // Returns a set of AutoFillFieldTypes for which this FormGroup has non-empty + // Returns a set of AutofillFieldTypes for which this FormGroup has non-empty // data. virtual void GetAvailableFieldTypes(FieldTypeSet* available_types) const = 0; diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc index 19356f3..acfa1e4 100644 --- a/chrome/browser/autofill/form_structure.cc +++ b/chrome/browser/autofill/form_structure.cc @@ -172,7 +172,7 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml, metric_logger.Log(AutofillMetrics::QUERY_RESPONSE_RECEIVED); // Parse the field types from the server response to the query. - std::vector<AutoFillFieldType> field_types; + std::vector<AutofillFieldType> field_types; std::string experiment_id; AutoFillQueryXmlParser parse_handler(&field_types, upload_required, &experiment_id); @@ -187,7 +187,7 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml, bool query_response_overrode_heuristics = false; // Copy the field types into the actual form. - std::vector<AutoFillFieldType>::iterator current_type = field_types.begin(); + std::vector<AutofillFieldType>::iterator current_type = field_types.begin(); for (std::vector<FormStructure*>::const_iterator iter = forms.begin(); iter != forms.end(); ++iter) { FormStructure* form = *iter; @@ -213,7 +213,7 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml, // UNKNOWN_TYPE is reserved for use by the client. DCHECK_NE(*current_type, UNKNOWN_TYPE); - AutoFillFieldType heuristic_type = (*field)->type(); + AutofillFieldType heuristic_type = (*field)->type(); (*field)->set_server_type(*current_type); if (heuristic_type != (*field)->type()) query_response_overrode_heuristics = true; @@ -370,7 +370,7 @@ void FormStructure::GetHeuristicAutoFillTypes() { DCHECK(field); FieldTypeMap::iterator iter = field_type_map.find(field->unique_name()); - AutoFillFieldType heuristic_auto_fill_type; + AutofillFieldType heuristic_auto_fill_type; if (iter == field_type_map.end()) { heuristic_auto_fill_type = UNKNOWN_TYPE; } else { diff --git a/chrome/browser/autofill/home_phone_number.cc b/chrome/browser/autofill/home_phone_number.cc index f48efa8..fb19c8d 100644 --- a/chrome/browser/autofill/home_phone_number.cc +++ b/chrome/browser/autofill/home_phone_number.cc @@ -8,22 +8,22 @@ FormGroup* HomePhoneNumber::Clone() const { return new HomePhoneNumber(*this); } -AutoFillFieldType HomePhoneNumber::GetNumberType() const { +AutofillFieldType HomePhoneNumber::GetNumberType() const { return PHONE_HOME_NUMBER; } -AutoFillFieldType HomePhoneNumber::GetCityCodeType() const { +AutofillFieldType HomePhoneNumber::GetCityCodeType() const { return PHONE_HOME_CITY_CODE; } -AutoFillFieldType HomePhoneNumber::GetCountryCodeType() const { +AutofillFieldType HomePhoneNumber::GetCountryCodeType() const { return PHONE_HOME_COUNTRY_CODE; } -AutoFillFieldType HomePhoneNumber::GetCityAndNumberType() const { +AutofillFieldType HomePhoneNumber::GetCityAndNumberType() const { return PHONE_HOME_CITY_AND_NUMBER; } -AutoFillFieldType HomePhoneNumber::GetWholeNumberType() const { +AutofillFieldType HomePhoneNumber::GetWholeNumberType() const { return PHONE_HOME_WHOLE_NUMBER; } diff --git a/chrome/browser/autofill/home_phone_number.h b/chrome/browser/autofill/home_phone_number.h index 3e311e6..c24df79 100644 --- a/chrome/browser/autofill/home_phone_number.h +++ b/chrome/browser/autofill/home_phone_number.h @@ -16,11 +16,11 @@ class HomePhoneNumber : public PhoneNumber { virtual FormGroup* Clone() const; protected: - virtual AutoFillFieldType GetNumberType() const; - virtual AutoFillFieldType GetCityCodeType() const; - virtual AutoFillFieldType GetCountryCodeType() const; - virtual AutoFillFieldType GetCityAndNumberType() const; - virtual AutoFillFieldType GetWholeNumberType() const; + virtual AutofillFieldType GetNumberType() const; + virtual AutofillFieldType GetCityCodeType() const; + virtual AutofillFieldType GetCountryCodeType() const; + virtual AutofillFieldType GetCityAndNumberType() const; + virtual AutofillFieldType GetWholeNumberType() const; private: explicit HomePhoneNumber(const HomePhoneNumber& phone) : PhoneNumber(phone) {} diff --git a/chrome/browser/autofill/phone_number.cc b/chrome/browser/autofill/phone_number.cc index 025f031..c7c0c7c 100644 --- a/chrome/browser/autofill/phone_number.cc +++ b/chrome/browser/autofill/phone_number.cc @@ -79,7 +79,7 @@ void PhoneNumber::GetAvailableFieldTypes(FieldTypeSet* available_types) const { } string16 PhoneNumber::GetFieldText(const AutoFillType& type) const { - AutoFillFieldType field_type = type.field_type(); + AutofillFieldType field_type = type.field_type(); if (field_type == GetNumberType()) return number(); diff --git a/chrome/browser/autofill/phone_number.h b/chrome/browser/autofill/phone_number.h index 3bb94ca..8cf873b 100644 --- a/chrome/browser/autofill/phone_number.h +++ b/chrome/browser/autofill/phone_number.h @@ -47,11 +47,11 @@ class PhoneNumber : public FormGroup { // The following functions should return the field type for each part of the // phone number. Currently, these are either fax or home phone number types. - virtual AutoFillFieldType GetNumberType() const = 0; - virtual AutoFillFieldType GetCityCodeType() const = 0; - virtual AutoFillFieldType GetCountryCodeType() const = 0; - virtual AutoFillFieldType GetCityAndNumberType() const = 0; - virtual AutoFillFieldType GetWholeNumberType() const = 0; + virtual AutofillFieldType GetNumberType() const = 0; + virtual AutofillFieldType GetCityCodeType() const = 0; + virtual AutofillFieldType GetCountryCodeType() const = 0; + virtual AutofillFieldType GetCityAndNumberType() const = 0; + virtual AutofillFieldType GetWholeNumberType() const = 0; protected: explicit PhoneNumber(const PhoneNumber& phone_number); |