diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 12:29:57 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 12:29:57 +0000 |
commit | c87481cd83101d6a2d9aa2809d7728933339ef62 (patch) | |
tree | 9ac1ea71b203f795a27816849b644ef6566f6fe6 /chrome | |
parent | b4cb02ac97ef8889c5bcbe9d78e0472a6c6e46fb (diff) | |
download | chromium_src-c87481cd83101d6a2d9aa2809d7728933339ef62.zip chromium_src-c87481cd83101d6a2d9aa2809d7728933339ef62.tar.gz chromium_src-c87481cd83101d6a2d9aa2809d7728933339ef62.tar.bz2 |
autofill: Rename AutoFillField to AutofillField.
BUG=72758
TEST=existing unit_tests
Review URL: http://codereview.chromium.org/6621008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
28 files changed, 315 insertions, 316 deletions
diff --git a/chrome/browser/autofill/address_field.cc b/chrome/browser/autofill/address_field.cc index 2e10bdb..3bb3c21 100644 --- a/chrome/browser/autofill/address_field.cc +++ b/chrome/browser/autofill/address_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -74,14 +74,14 @@ FormFieldType AddressField::GetFormFieldType() const { } AddressField* AddressField::Parse( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml) { DCHECK(iter); if (!iter) return NULL; scoped_ptr<AddressField> address_field(new AddressField); - std::vector<AutoFillField*>::const_iterator q = *iter; + std::vector<AutofillField*>::const_iterator q = *iter; string16 pattern; // The ECML standard uses 2 letter country codes. So we will @@ -167,7 +167,7 @@ AddressField::AddressField() // static bool AddressField::ParseCompany( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field) { if (address_field->company_ && !address_field->company_->IsEmpty()) return false; @@ -187,7 +187,7 @@ bool AddressField::ParseCompany( // static bool AddressField::ParseAddressLines( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field) { // We only match the string "address" in page text, not in element names, // because sometimes every element in a group of address fields will have @@ -248,7 +248,7 @@ bool AddressField::ParseAddressLines( // static bool AddressField::ParseCountry( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field) { // Parse a country. The occasional page (e.g. // Travelocity_New Member Information1.html) calls this a "location". @@ -270,7 +270,7 @@ bool AddressField::ParseCountry( // static bool AddressField::ParseZipCode( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field) { // Parse a zip code. On some UK pages (e.g. The China Shop2.html) this // is called a "post code". @@ -325,7 +325,7 @@ bool AddressField::ParseZipCode( // static bool AddressField::ParseCity( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field) { // Parse a city name. Some UK pages (e.g. The China Shop2.html) use // the term "town". @@ -346,7 +346,7 @@ bool AddressField::ParseCity( // static bool AddressField::ParseState( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field) { if (address_field->state_) return false; diff --git a/chrome/browser/autofill/address_field.h b/chrome/browser/autofill/address_field.h index 116ae35..8d16270 100644 --- a/chrome/browser/autofill/address_field.h +++ b/chrome/browser/autofill/address_field.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,14 +11,14 @@ #include "chrome/browser/autofill/autofill_type.h" #include "chrome/browser/autofill/form_field.h" -class AutoFillField; +class AutofillField; class AddressField : public FormField { public: virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const; virtual FormFieldType GetFormFieldType() const; - static AddressField* Parse(std::vector<AutoFillField*>::const_iterator* iter, + static AddressField* Parse(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml); // Tries to determine the billing/shipping type of this address. @@ -33,32 +33,32 @@ class AddressField : public FormField { private: AddressField(); - static bool ParseCompany(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseCompany(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field); static bool ParseAddressLines( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field); - static bool ParseCountry(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseCountry(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field); - static bool ParseZipCode(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseZipCode(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field); - static bool ParseCity(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseCity(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field); - static bool ParseState(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseState(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml, AddressField* address_field); // Looks for an address type in the given text, which the caller must // convert to lowercase. static AddressType AddressTypeFromText(const string16& text); - AutoFillField* company_; // optional - AutoFillField* address1_; - AutoFillField* address2_; // optional - AutoFillField* city_; - AutoFillField* state_; // optional - AutoFillField* zip_; - AutoFillField* zip4_; // optional ZIP+4; we don't fill this yet - AutoFillField* country_; // optional + AutofillField* company_; // optional + AutofillField* address1_; + AutofillField* address2_; // optional + AutofillField* city_; + AutofillField* state_; // optional + AutofillField* zip_; + AutofillField* zip4_; // optional ZIP+4; we don't fill this yet + AutofillField* country_; // optional AddressType type_; bool is_ecml_; diff --git a/chrome/browser/autofill/address_field_unittest.cc b/chrome/browser/autofill/address_field_unittest.cc index d6a42db..8ebb334 100644 --- a/chrome/browser/autofill/address_field_unittest.cc +++ b/chrome/browser/autofill/address_field_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,10 +16,10 @@ class AddressFieldTest : public testing::Test { AddressFieldTest() {} protected: - ScopedVector<AutoFillField> list_; + ScopedVector<AutofillField> list_; scoped_ptr<AddressField> field_; FieldTypeMap field_type_map_; - std::vector<AutoFillField*>::const_iterator iter_; + std::vector<AutofillField*>::const_iterator iter_; private: DISALLOW_COPY_AND_ASSIGN(AddressFieldTest); @@ -33,7 +33,7 @@ TEST_F(AddressFieldTest, Empty) { } TEST_F(AddressFieldTest, NonParse) { - list_.push_back(new AutoFillField); + list_.push_back(new AutofillField); list_.push_back(NULL); iter_ = list_.begin(); field_.reset(AddressField::Parse(&iter_, false)); @@ -42,7 +42,7 @@ TEST_F(AddressFieldTest, NonParse) { TEST_F(AddressFieldTest, ParseOneLineAddress) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address"), ASCIIToUTF16("address"), string16(), ASCIIToUTF16("text"), @@ -63,7 +63,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddress) { TEST_F(AddressFieldTest, ParseOneLineAddressBilling) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address"), ASCIIToUTF16("billingAddress"), string16(), ASCIIToUTF16("text"), @@ -84,7 +84,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddressBilling) { TEST_F(AddressFieldTest, ParseOneLineAddressShipping) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address"), ASCIIToUTF16("shippingAddress"), string16(), ASCIIToUTF16("text"), @@ -105,7 +105,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddressShipping) { TEST_F(AddressFieldTest, ParseOneLineAddressEcml) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Address"), ASCIIToUTF16(kEcmlShipToAddress1), string16(), @@ -127,7 +127,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddressEcml) { TEST_F(AddressFieldTest, ParseTwoLineAddress) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address"), ASCIIToUTF16("address"), string16(), ASCIIToUTF16("text"), @@ -135,7 +135,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddress) { false), ASCIIToUTF16("addr1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), string16(), string16(), ASCIIToUTF16("text"), @@ -159,7 +159,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddress) { TEST_F(AddressFieldTest, ParseThreeLineAddress) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address Line1"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address Line1"), ASCIIToUTF16("Address"), string16(), ASCIIToUTF16("text"), @@ -167,7 +167,7 @@ TEST_F(AddressFieldTest, ParseThreeLineAddress) { false), ASCIIToUTF16("addr1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address Line2"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address Line2"), ASCIIToUTF16("Address"), string16(), ASCIIToUTF16("text"), @@ -175,7 +175,7 @@ TEST_F(AddressFieldTest, ParseThreeLineAddress) { false), ASCIIToUTF16("addr2"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address Line3"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address Line3"), ASCIIToUTF16("Address"), string16(), ASCIIToUTF16("text"), @@ -201,7 +201,7 @@ TEST_F(AddressFieldTest, ParseThreeLineAddress) { TEST_F(AddressFieldTest, ParseTwoLineAddressEcml) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Address"), ASCIIToUTF16(kEcmlShipToAddress1), string16(), @@ -210,7 +210,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddressEcml) { false), ASCIIToUTF16("addr1"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(string16(), ASCIIToUTF16(kEcmlShipToAddress2), string16(), @@ -235,7 +235,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddressEcml) { TEST_F(AddressFieldTest, ParseCity) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("City"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("City"), ASCIIToUTF16("city"), string16(), ASCIIToUTF16("text"), @@ -256,7 +256,7 @@ TEST_F(AddressFieldTest, ParseCity) { TEST_F(AddressFieldTest, ParseCityEcml) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("City"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("City"), ASCIIToUTF16(kEcmlShipToCity), string16(), ASCIIToUTF16("text"), @@ -277,7 +277,7 @@ TEST_F(AddressFieldTest, ParseCityEcml) { TEST_F(AddressFieldTest, ParseState) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("State"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("State"), ASCIIToUTF16("state"), string16(), ASCIIToUTF16("text"), @@ -298,7 +298,7 @@ TEST_F(AddressFieldTest, ParseState) { TEST_F(AddressFieldTest, ParseStateEcml) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("State"), ASCIIToUTF16(kEcmlShipToStateProv), string16(), @@ -320,7 +320,7 @@ TEST_F(AddressFieldTest, ParseStateEcml) { TEST_F(AddressFieldTest, ParseZip) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Zip"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Zip"), ASCIIToUTF16("zip"), string16(), ASCIIToUTF16("text"), @@ -341,7 +341,7 @@ TEST_F(AddressFieldTest, ParseZip) { TEST_F(AddressFieldTest, ParseZipEcml) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Zip"), ASCIIToUTF16(kEcmlShipToPostalCode), string16(), @@ -363,7 +363,7 @@ TEST_F(AddressFieldTest, ParseZipEcml) { TEST_F(AddressFieldTest, ParseStateAndZipOneLabel) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField( ASCIIToUTF16("State/Province, Zip/Postal Code"), ASCIIToUTF16("state"), @@ -373,7 +373,7 @@ TEST_F(AddressFieldTest, ParseStateAndZipOneLabel) { false), ASCIIToUTF16("state"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField( ASCIIToUTF16("State/Province, Zip/Postal Code"), ASCIIToUTF16("zip"), @@ -399,7 +399,7 @@ TEST_F(AddressFieldTest, ParseStateAndZipOneLabel) { TEST_F(AddressFieldTest, ParseCountry) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Country"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Country"), ASCIIToUTF16("country"), string16(), ASCIIToUTF16("text"), @@ -420,7 +420,7 @@ TEST_F(AddressFieldTest, ParseCountry) { TEST_F(AddressFieldTest, ParseCountryEcml) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Country"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Country"), ASCIIToUTF16(kEcmlShipToCountry), string16(), ASCIIToUTF16("text"), @@ -441,7 +441,7 @@ TEST_F(AddressFieldTest, ParseCountryEcml) { TEST_F(AddressFieldTest, ParseTwoLineAddressMissingLabel) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Address"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Address"), ASCIIToUTF16("address"), string16(), ASCIIToUTF16("text"), @@ -449,7 +449,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddressMissingLabel) { false), ASCIIToUTF16("addr1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("bogus"), string16(), ASCIIToUTF16("text"), @@ -473,7 +473,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddressMissingLabel) { TEST_F(AddressFieldTest, ParseCompany) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Company"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Company"), ASCIIToUTF16("company"), string16(), ASCIIToUTF16("text"), @@ -494,7 +494,7 @@ TEST_F(AddressFieldTest, ParseCompany) { TEST_F(AddressFieldTest, ParseCompanyEcml) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Company"), ASCIIToUTF16(kEcmlShipToCompanyName), string16(), diff --git a/chrome/browser/autofill/autofill_field.cc b/chrome/browser/autofill/autofill_field.cc index 9f4b2d9..1127031 100644 --- a/chrome/browser/autofill/autofill_field.cc +++ b/chrome/browser/autofill/autofill_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,12 +25,12 @@ static std::string Hash32Bit(const std::string& str) { } // namespace -AutoFillField::AutoFillField() +AutofillField::AutofillField() : server_type_(NO_SERVER_DATA), heuristic_type_(UNKNOWN_TYPE) { } -AutoFillField::AutoFillField(const webkit_glue::FormField& field, +AutofillField::AutofillField(const webkit_glue::FormField& field, const string16& unique_name) : webkit_glue::FormField(field), unique_name_(unique_name), @@ -38,9 +38,9 @@ AutoFillField::AutoFillField(const webkit_glue::FormField& field, heuristic_type_(UNKNOWN_TYPE) { } -AutoFillField::~AutoFillField() {} +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,24 +51,24 @@ 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_; return heuristic_type_; } -bool AutoFillField::IsEmpty() const { +bool AutofillField::IsEmpty() const { return value().empty(); } -std::string AutoFillField::FieldSignature() const { +std::string AutofillField::FieldSignature() const { std::string field_name = UTF16ToUTF8(name()); std::string type = UTF16ToUTF8(form_control_type()); std::string field_string = field_name + "&" + type; return Hash32Bit(field_string); } -bool AutoFillField::IsFieldFillable() const { +bool AutofillField::IsFieldFillable() const { return type() != UNKNOWN_TYPE; } diff --git a/chrome/browser/autofill/autofill_field.h b/chrome/browser/autofill/autofill_field.h index b72313a..6542ebb 100644 --- a/chrome/browser/autofill/autofill_field.h +++ b/chrome/browser/autofill/autofill_field.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,12 +12,12 @@ #include "chrome/browser/autofill/field_types.h" #include "webkit/glue/form_field.h" -class AutoFillField : public webkit_glue::FormField { +class AutofillField : public webkit_glue::FormField { public: - AutoFillField(); - AutoFillField(const webkit_glue::FormField& field, + AutofillField(); + AutofillField(const webkit_glue::FormField& field, const string16& unique_name); - virtual ~AutoFillField(); + virtual ~AutofillField(); const string16& unique_name() const { return unique_name_; } @@ -60,7 +60,7 @@ class AutoFillField : public webkit_glue::FormField { // The set of possible types for this field. FieldTypeSet possible_types_; - DISALLOW_COPY_AND_ASSIGN(AutoFillField); + DISALLOW_COPY_AND_ASSIGN(AutofillField); }; #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_FIELD_H_ diff --git a/chrome/browser/autofill/autofill_field_unittest.cc b/chrome/browser/autofill/autofill_field_unittest.cc index 712ddf8..7723551 100644 --- a/chrome/browser/autofill/autofill_field_unittest.cc +++ b/chrome/browser/autofill/autofill_field_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,8 +10,8 @@ namespace { -TEST(AutoFillFieldTest, Type) { - AutoFillField field; +TEST(AutofillFieldTest, Type) { + AutofillField field; ASSERT_EQ(NO_SERVER_DATA, field.server_type()); ASSERT_EQ(UNKNOWN_TYPE, field.heuristic_type()); @@ -31,8 +31,8 @@ TEST(AutoFillFieldTest, Type) { EXPECT_EQ(NAME_FIRST, field.type()); } -TEST(AutoFillFieldTest, IsEmpty) { - AutoFillField field; +TEST(AutofillFieldTest, IsEmpty) { + AutofillField field; ASSERT_EQ(string16(), field.value()); // Field value is empty. @@ -43,8 +43,8 @@ TEST(AutoFillFieldTest, IsEmpty) { EXPECT_FALSE(field.IsEmpty()); } -TEST(AutoFillFieldTest, FieldSignature) { - AutoFillField field; +TEST(AutofillFieldTest, FieldSignature) { + AutofillField field; ASSERT_EQ(string16(), field.name()); ASSERT_EQ(string16(), field.form_control_type()); @@ -68,8 +68,8 @@ TEST(AutoFillFieldTest, FieldSignature) { EXPECT_EQ("4246049809", field.FieldSignature()); } -TEST(AutoFillFieldTest, IsFieldFillable) { - AutoFillField field; +TEST(AutofillFieldTest, IsFieldFillable) { + AutofillField field; ASSERT_EQ(UNKNOWN_TYPE, field.type()); // Type is unknown. diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index e594663..af1d5b1 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -94,7 +94,7 @@ void RemoveDuplicateSuggestions(std::vector<string16>* values, // 2. A logical section should not include multiple fields of the same autofill // type (except for phone/fax numbers, as described below). void FindSectionBounds(const FormStructure& form, - const AutoFillField& field, + const AutofillField& field, bool is_filling_credit_card, size_t* section_start, size_t* section_end) { @@ -108,7 +108,7 @@ void FindSectionBounds(const FormStructure& form, 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 AutofillField* current_field = form.field(i); const AutofillFieldType current_type = AutoFillType::GetEquivalentFieldType(current_field->type()); @@ -325,7 +325,7 @@ void AutoFillManager::OnQueryFormFieldAutoFill( RenderViewHost* host = NULL; FormStructure* form_structure = NULL; - AutoFillField* autofill_field = NULL; + AutofillField* autofill_field = NULL; if (GetHost( personal_data_->profiles(), personal_data_->credit_cards(), &host) && FindCachedFormAndField(form, field, &form_structure, &autofill_field) && @@ -393,7 +393,7 @@ void AutoFillManager::OnFillAutoFillFormData(int query_id, const std::vector<CreditCard*>& credit_cards = personal_data_->credit_cards(); RenderViewHost* host = NULL; FormStructure* form_structure = NULL; - AutoFillField* autofill_field = NULL; + AutofillField* autofill_field = NULL; if (!GetHost(profiles, credit_cards, &host) || !FindCachedFormAndField(form, field, &form_structure, &autofill_field)) return; @@ -575,7 +575,7 @@ bool AutoFillManager::IsAutoFillEnabled() const { void AutoFillManager::DeterminePossibleFieldTypesForUpload( FormStructure* submitted_form) { for (size_t i = 0; i < submitted_form->field_count(); i++) { - const AutoFillField* field = submitted_form->field(i); + const AutofillField* field = submitted_form->field(i); FieldTypeSet field_types; personal_data_->GetPossibleFieldTypes(field->value(), &field_types); @@ -594,15 +594,15 @@ void AutoFillManager::LogMetricsAboutSubmittedForm( } // Map from field signatures to cached fields. - std::map<std::string, const AutoFillField*> cached_fields; + std::map<std::string, const AutofillField*> cached_fields; for (size_t i = 0; i < cached_submitted_form->field_count(); ++i) { - const AutoFillField* field = cached_submitted_form->field(i); + const AutofillField* field = cached_submitted_form->field(i); cached_fields[field->FieldSignature()] = field; } std::string experiment_id = cached_submitted_form->server_experiment_id(); for (size_t i = 0; i < submitted_form->field_count(); ++i) { - const AutoFillField* field = submitted_form->field(i); + const AutofillField* field = submitted_form->field(i); FieldTypeSet field_types; personal_data_->GetPossibleFieldTypes(field->value(), &field_types); DCHECK(!field_types.empty()); @@ -626,7 +626,7 @@ void AutoFillManager::LogMetricsAboutSubmittedForm( AutofillFieldType heuristic_type = UNKNOWN_TYPE; AutofillFieldType server_type = NO_SERVER_DATA; - std::map<std::string, const AutoFillField*>::const_iterator + std::map<std::string, const AutofillField*>::const_iterator cached_field = cached_fields.find(field->FieldSignature()); if (cached_field != cached_fields.end()) { heuristic_type = cached_field->second->heuristic_type(); @@ -769,7 +769,7 @@ bool AutoFillManager::FindCachedForm(const FormData& form, bool AutoFillManager::FindCachedFormAndField(const FormData& form, const FormField& field, FormStructure** form_structure, - AutoFillField** autofill_field) { + AutofillField** autofill_field) { // Find the FormStructure that corresponds to |form|. if (!FindCachedForm(form, form_structure)) return false; @@ -778,12 +778,12 @@ bool AutoFillManager::FindCachedFormAndField(const FormData& form, if (!(*form_structure)->autofill_count()) return false; - // Find the AutoFillField that corresponds to |field|. + // Find the AutofillField that corresponds to |field|. *autofill_field = NULL; - for (std::vector<AutoFillField*>::const_iterator iter = + for (std::vector<AutofillField*>::const_iterator iter = (*form_structure)->begin(); iter != (*form_structure)->end(); ++iter) { - // The field list is terminated with a NULL AutoFillField, so don't try to + // The field list is terminated with a NULL AutofillField, so don't try to // dereference it. if (!*iter) break; @@ -826,9 +826,9 @@ void AutoFillManager::GetProfileSuggestions(FormStructure* form, std::vector<AutofillFieldType> form_fields; form_fields.reserve(form->field_count()); - for (std::vector<AutoFillField*>::const_iterator iter = form->begin(); + for (std::vector<AutofillField*>::const_iterator iter = form->begin(); iter != form->end(); ++iter) { - // The field list is terminated with a NULL AutoFillField, so don't try to + // The field list is terminated with a NULL AutofillField, so don't try to // dereference it. if (!*iter) break; diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index 287117c..15537ae 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -133,7 +133,7 @@ class AutoFillManager : public TabContentsObserver, const webkit_glue::FormData& form, const webkit_glue::FormField& field, FormStructure** form_structure, - AutoFillField** autofill_field) WARN_UNUSED_RESULT; + AutofillField** autofill_field) WARN_UNUSED_RESULT; // Returns a list of values from the stored profiles that match |type| and the // value of |field| and returns the labels of the matching profiles. |labels| diff --git a/chrome/browser/autofill/autofill_merge_unittest.cc b/chrome/browser/autofill/autofill_merge_unittest.cc index fd97e17..4ed3b00 100644 --- a/chrome/browser/autofill/autofill_merge_unittest.cc +++ b/chrome/browser/autofill/autofill_merge_unittest.cc @@ -195,8 +195,8 @@ void AutoFillMergeTest::MergeProfiles(const std::string& profiles, for (size_t i = 0; i < form_structure.field_count(); ++i) { // Set the heuristic type for each field, which is currently serialized // into the field's name. - AutoFillField* field = - const_cast<AutoFillField*>(form_structure.field(i)); + AutofillField* field = + const_cast<AutofillField*>(form_structure.field(i)); 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 e793c7b..e43886ad 100644 --- a/chrome/browser/autofill/autofill_metrics_unittest.cc +++ b/chrome/browser/autofill/autofill_metrics_unittest.cc @@ -164,7 +164,7 @@ class TestFormStructure : public FormStructure { ASSERT_EQ(field_count(), server_types.size()); for (size_t i = 0; i < field_count(); ++i) { - AutoFillField* field = (*fields())[i]; + AutofillField* field = (*fields())[i]; ASSERT_TRUE(field); field->set_heuristic_type(heuristic_types[i]); field->set_server_type(server_types[i]); diff --git a/chrome/browser/autofill/credit_card_field.cc b/chrome/browser/autofill/credit_card_field.cc index 746bdf9..f0c4e80 100644 --- a/chrome/browser/autofill/credit_card_field.cc +++ b/chrome/browser/autofill/credit_card_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -43,10 +43,10 @@ FormFieldType CreditCardField::GetFormFieldType() const { // static CreditCardField* CreditCardField::Parse( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml) { scoped_ptr<CreditCardField> credit_card_field(new CreditCardField); - std::vector<AutoFillField*>::const_iterator q = *iter; + std::vector<AutofillField*>::const_iterator q = *iter; string16 pattern; // Credit card fields can appear in many different orders. @@ -81,8 +81,8 @@ CreditCardField* CreditCardField::Parse( // and ExpediaBilling.html in our test suite), recognize separate fields // for the cardholder's first and last name if they have the labels "cfnm" // and "clnm". - std::vector<AutoFillField*>::const_iterator p = q; - AutoFillField* first; + std::vector<AutofillField*>::const_iterator p = q; + AutofillField* first; if (!is_ecml && ParseText(&p, ASCIIToUTF16("^cfnm"), &first) && ParseText(&p, ASCIIToUTF16("^clnm"), &credit_card_field->cardholder_last_)) { diff --git a/chrome/browser/autofill/credit_card_field.h b/chrome/browser/autofill/credit_card_field.h index fdb52bd..4a44686 100644 --- a/chrome/browser/autofill/credit_card_field.h +++ b/chrome/browser/autofill/credit_card_field.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,7 +10,7 @@ #include "chrome/browser/autofill/form_field.h" -class AutoFillField; +class AutofillField; class CreditCardField : public FormField { public: @@ -19,13 +19,13 @@ class CreditCardField : public FormField { virtual FormFieldType GetFormFieldType() const; static CreditCardField* Parse( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml); private: CreditCardField(); - AutoFillField* cardholder_; // Optional. + AutofillField* cardholder_; // Optional. // Occasionally pages have separate fields for the cardholder's first and // last names; for such pages cardholder_ holds the first name field and @@ -34,17 +34,17 @@ class CreditCardField : public FormField { // because the text patterns for matching a cardholder name are different // than for ordinary names, and because cardholder names never have titles, // middle names or suffixes.) - AutoFillField* cardholder_last_; + AutofillField* cardholder_last_; - AutoFillField* type_; // Optional. TODO(jhawkins): Parse the select control. - AutoFillField* number_; // Required. + AutofillField* type_; // Optional. TODO(jhawkins): Parse the select control. + AutofillField* number_; // Required. // The 3-digit card verification number; we don't currently fill this. - AutoFillField* verification_; + AutofillField* verification_; // Both required. TODO(jhawkins): Parse the select control. - AutoFillField* expiration_month_; - AutoFillField* expiration_year_; + AutofillField* expiration_month_; + AutofillField* expiration_year_; DISALLOW_COPY_AND_ASSIGN(CreditCardField); }; diff --git a/chrome/browser/autofill/credit_card_field_unittest.cc b/chrome/browser/autofill/credit_card_field_unittest.cc index 8c41b4f..8373c8c 100644 --- a/chrome/browser/autofill/credit_card_field_unittest.cc +++ b/chrome/browser/autofill/credit_card_field_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,10 +16,10 @@ class CreditCardFieldTest : public testing::Test { CreditCardFieldTest() {} protected: - ScopedVector<AutoFillField> list_; + ScopedVector<AutofillField> list_; scoped_ptr<CreditCardField> field_; FieldTypeMap field_type_map_; - std::vector<AutoFillField*>::const_iterator iter_; + std::vector<AutofillField*>::const_iterator iter_; private: DISALLOW_COPY_AND_ASSIGN(CreditCardFieldTest); @@ -33,7 +33,7 @@ TEST_F(CreditCardFieldTest, Empty) { } TEST_F(CreditCardFieldTest, NonParse) { - list_.push_back(new AutoFillField); + list_.push_back(new AutofillField); list_.push_back(NULL); iter_ = list_.begin(); field_.reset(CreditCardField::Parse(&iter_, false)); @@ -42,7 +42,7 @@ TEST_F(CreditCardFieldTest, NonParse) { TEST_F(CreditCardFieldTest, ParseCreditCardNoNumber) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Exp Month"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Exp Month"), ASCIIToUTF16("ccmonth"), string16(), ASCIIToUTF16("text"), @@ -50,7 +50,7 @@ TEST_F(CreditCardFieldTest, ParseCreditCardNoNumber) { false), ASCIIToUTF16("month1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Exp Year"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Exp Year"), ASCIIToUTF16("ccyear"), string16(), ASCIIToUTF16("text"), @@ -65,7 +65,7 @@ TEST_F(CreditCardFieldTest, ParseCreditCardNoNumber) { TEST_F(CreditCardFieldTest, ParseCreditCardNoDate) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), ASCIIToUTF16("card_number"), string16(), ASCIIToUTF16("text"), @@ -80,7 +80,7 @@ TEST_F(CreditCardFieldTest, ParseCreditCardNoDate) { TEST_F(CreditCardFieldTest, ParseMiniumCreditCard) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), ASCIIToUTF16("card_number"), string16(), ASCIIToUTF16("text"), @@ -88,7 +88,7 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCard) { false), ASCIIToUTF16("number1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Exp Month"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Exp Month"), ASCIIToUTF16("ccmonth"), string16(), ASCIIToUTF16("text"), @@ -96,7 +96,7 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCard) { false), ASCIIToUTF16("month1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Exp Year"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Exp Year"), ASCIIToUTF16("ccyear"), string16(), ASCIIToUTF16("text"), @@ -122,7 +122,7 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCard) { TEST_F(CreditCardFieldTest, ParseMiniumCreditCardEcml) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), ASCIIToUTF16(kEcmlCardNumber), string16(), ASCIIToUTF16("text"), @@ -130,7 +130,7 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCardEcml) { false), ASCIIToUTF16("number1"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Exp Month"), ASCIIToUTF16(kEcmlCardExpireMonth), string16(), @@ -139,7 +139,7 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCardEcml) { false), ASCIIToUTF16("month1"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Exp Year"), ASCIIToUTF16(kEcmlCardExpireYear), string16(), @@ -166,7 +166,7 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCardEcml) { TEST_F(CreditCardFieldTest, ParseFullCreditCard) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), ASCIIToUTF16("name on card"), string16(), ASCIIToUTF16("text"), @@ -174,7 +174,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCard) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), ASCIIToUTF16("card_number"), string16(), ASCIIToUTF16("text"), @@ -182,7 +182,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCard) { false), ASCIIToUTF16("number1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Exp Month"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Exp Month"), ASCIIToUTF16("ccmonth"), string16(), ASCIIToUTF16("text"), @@ -190,7 +190,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCard) { false), ASCIIToUTF16("month1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Exp Year"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Exp Year"), ASCIIToUTF16("ccyear"), string16(), ASCIIToUTF16("text"), @@ -198,7 +198,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCard) { false), ASCIIToUTF16("year1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Verification"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Verification"), ASCIIToUTF16("verification"), string16(), ASCIIToUTF16("text"), @@ -230,7 +230,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCard) { TEST_F(CreditCardFieldTest, ParseFullCreditCardEcml) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), ASCIIToUTF16(kEcmlCardHolder), string16(), ASCIIToUTF16("text"), @@ -238,7 +238,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCardEcml) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), ASCIIToUTF16(kEcmlCardNumber), string16(), ASCIIToUTF16("text"), @@ -246,7 +246,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCardEcml) { false), ASCIIToUTF16("number1"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Exp Month"), ASCIIToUTF16(kEcmlCardExpireMonth), string16(), @@ -255,7 +255,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCardEcml) { false), ASCIIToUTF16("month1"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Exp Year"), ASCIIToUTF16(kEcmlCardExpireYear), string16(), @@ -264,7 +264,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCardEcml) { false), ASCIIToUTF16("year1"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Verification"), ASCIIToUTF16(kEcmlCardVerification), string16(), @@ -297,7 +297,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCardEcml) { TEST_F(CreditCardFieldTest, ParseExpMonthYear) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), ASCIIToUTF16("Name"), string16(), ASCIIToUTF16("text"), @@ -305,7 +305,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear) { false), ASCIIToUTF16("name"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), ASCIIToUTF16("Card"), string16(), ASCIIToUTF16("text"), @@ -313,7 +313,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear) { false), ASCIIToUTF16("number"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("ExpDate Month / Year"), ASCIIToUTF16("ExpDate"), string16(), @@ -322,7 +322,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear) { false), ASCIIToUTF16("month"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("ExpDate Month / Year"), ASCIIToUTF16("ExpDate"), string16(), @@ -352,7 +352,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear) { TEST_F(CreditCardFieldTest, ParseExpMonthYear2) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name on Card"), ASCIIToUTF16("Name"), string16(), ASCIIToUTF16("text"), @@ -360,7 +360,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear2) { false), ASCIIToUTF16("name"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Card Number"), ASCIIToUTF16("Card"), string16(), ASCIIToUTF16("text"), @@ -368,7 +368,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear2) { false), ASCIIToUTF16("number"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Expiration date Month / Year"), ASCIIToUTF16("ExpDate"), string16(), @@ -377,7 +377,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear2) { false), ASCIIToUTF16("month"))); list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Expiration date Month / Year"), ASCIIToUTF16("ExpDate"), string16(), diff --git a/chrome/browser/autofill/form_field.cc b/chrome/browser/autofill/form_field.cc index e2d24dd..ab32729 100644 --- a/chrome/browser/autofill/form_field.cc +++ b/chrome/browser/autofill/form_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,9 +11,9 @@ #include "chrome/browser/autofill/credit_card_field.h" #include "chrome/browser/autofill/name_field.h" #include "chrome/browser/autofill/phone_field.h" +#include "grit/autofill_resources.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebRegularExpression.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" -#include "grit/autofill_resources.h" #include "ui/base/l10n/l10n_util.h" // Field names from the ECML specification; see RFC 3106. We've @@ -71,7 +71,7 @@ class EmailField : public FormField { return true; } - static EmailField* Parse(std::vector<AutoFillField*>::const_iterator* iter, + static EmailField* Parse(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml) { string16 pattern; if (is_ecml) { @@ -80,7 +80,7 @@ class EmailField : public FormField { pattern = l10n_util::GetStringUTF16(IDS_AUTOFILL_EMAIL_RE); } - AutoFillField* field; + AutofillField* field; if (ParseText(iter, pattern, &field)) return new EmailField(field); @@ -88,9 +88,9 @@ class EmailField : public FormField { } private: - explicit EmailField(AutoFillField *field) : field_(field) {} + explicit EmailField(AutofillField *field) : field_(field) {} - AutoFillField* field_; + AutofillField* field_; }; FormFieldType FormField::GetFormFieldType() const { @@ -98,7 +98,7 @@ FormFieldType FormField::GetFormFieldType() const { } // static -bool FormField::Match(AutoFillField* field, +bool FormField::Match(AutofillField* field, const string16& pattern, bool match_label_only) { if (match_label_only) { @@ -118,7 +118,7 @@ bool FormField::Match(AutoFillField* field, } // static -bool FormField::MatchName(AutoFillField* field, const string16& pattern) { +bool FormField::MatchName(AutofillField* field, const string16& pattern) { // TODO(jhawkins): Remove StringToLowerASCII. WebRegularExpression needs to // be fixed to take WebTextCaseInsensitive into account. WebKit::WebRegularExpression re(WebKit::WebString(pattern), @@ -129,7 +129,7 @@ bool FormField::MatchName(AutoFillField* field, const string16& pattern) { } // static -bool FormField::MatchLabel(AutoFillField* field, const string16& pattern) { +bool FormField::MatchLabel(AutofillField* field, const string16& pattern) { // TODO(jhawkins): Remove StringToLowerASCII. WebRegularExpression needs to // be fixed to take WebTextCaseInsensitive into account. WebKit::WebRegularExpression re(WebKit::WebString(pattern), @@ -141,7 +141,7 @@ bool FormField::MatchLabel(AutoFillField* field, const string16& pattern) { // static FormField* FormField::ParseFormField( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml) { FormField *field; field = EmailField::Parse(iter, is_ecml); @@ -164,40 +164,40 @@ FormField* FormField::ParseFormField( } // static -bool FormField::ParseText(std::vector<AutoFillField*>::const_iterator* iter, +bool FormField::ParseText(std::vector<AutofillField*>::const_iterator* iter, const string16& pattern) { - AutoFillField* field; + AutofillField* field; return ParseText(iter, pattern, &field); } // static -bool FormField::ParseText(std::vector<AutoFillField*>::const_iterator* iter, +bool FormField::ParseText(std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest) { + AutofillField** dest) { return ParseText(iter, pattern, dest, false); } // static bool FormField::ParseEmptyText( - std::vector<AutoFillField*>::const_iterator* iter, - AutoFillField** dest) { + std::vector<AutofillField*>::const_iterator* iter, + AutofillField** dest) { return ParseLabelText(iter, ASCIIToUTF16("^$"), dest); } // static bool FormField::ParseLabelText( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest) { + AutofillField** dest) { return ParseText(iter, pattern, dest, true); } // static -bool FormField::ParseText(std::vector<AutoFillField*>::const_iterator* iter, +bool FormField::ParseText(std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest, + AutofillField** dest, bool match_label_only) { - AutoFillField* field = **iter; + AutofillField* field = **iter; if (!field) return false; @@ -213,10 +213,10 @@ bool FormField::ParseText(std::vector<AutoFillField*>::const_iterator* iter, // static bool FormField::ParseLabelAndName( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest) { - AutoFillField* field = **iter; + AutofillField** dest) { + AutofillField* field = **iter; if (!field) return false; @@ -231,13 +231,13 @@ bool FormField::ParseLabelAndName( } // static -bool FormField::ParseEmpty(std::vector<AutoFillField*>::const_iterator* iter) { +bool FormField::ParseEmpty(std::vector<AutofillField*>::const_iterator* iter) { // TODO(jhawkins): Handle select fields. return ParseLabelAndName(iter, ASCIIToUTF16("^$"), NULL); } // static -bool FormField::Add(FieldTypeMap* field_type_map, AutoFillField* field, +bool FormField::Add(FieldTypeMap* field_type_map, AutofillField* field, const AutoFillType& type) { // Several fields are optional. if (field) @@ -265,7 +265,7 @@ FormFieldSet::FormFieldSet(FormStructure* fields) { bool is_ecml = CheckECML(fields); // Parse fields. - std::vector<AutoFillField*>::const_iterator field = fields->begin(); + std::vector<AutofillField*>::const_iterator field = fields->begin(); while (field != fields->end() && *field != NULL) { FormField* form_field = FormField::ParseFormField(&field, is_ecml); if (!form_field) { diff --git a/chrome/browser/autofill/form_field.h b/chrome/browser/autofill/form_field.h index 4c5e02b..03c9f7d 100644 --- a/chrome/browser/autofill/form_field.h +++ b/chrome/browser/autofill/form_field.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -61,7 +61,7 @@ enum FormFieldType { kOtherFieldType }; -class AutoFillField; +class AutofillField; // Represents a logical form field in a web form. Classes that implement this // interface can identify themselves as a particular type of form field, e.g. @@ -79,43 +79,43 @@ class FormField { // Returns true if |field| contains the regexp |pattern| in the name or label. // If |match_label_only| is true, then only the field's label is considered. - static bool Match(AutoFillField* field, + static bool Match(AutofillField* field, const string16& pattern, bool match_label_only); // Parses a field using the different field views we know about. |is_ecml| // should be true when the field conforms to the ECML specification. static FormField* ParseFormField( - std::vector<AutoFillField*>::const_iterator* field, + std::vector<AutofillField*>::const_iterator* field, bool is_ecml); // Attempts to parse a text field with the given pattern; returns true on // success, but doesn't return the actual text field itself. - static bool ParseText(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseText(std::vector<AutofillField*>::const_iterator* iter, const string16& pattern); // Attempts to parse a text field with the given pattern. Returns true on // success and fills |dest| with a pointer to the field. - static bool ParseText(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseText(std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest); + AutofillField** dest); // Attempts to parse a text field with an empty name or label. Returns true // on success and fills |dest| with a pointer to the field. - static bool ParseEmptyText(std::vector<AutoFillField*>::const_iterator* iter, - AutoFillField** dest); + static bool ParseEmptyText(std::vector<AutofillField*>::const_iterator* iter, + AutofillField** dest); // Attempts to parse a text field label with the given pattern. Returns true // on success and fills |dest| with a pointer to the field. - static bool ParseLabelText(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseLabelText(std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest); + AutofillField** dest); // Attempts to parse a control with an empty label. - static bool ParseEmpty(std::vector<AutoFillField*>::const_iterator* iter); + static bool ParseEmpty(std::vector<AutofillField*>::const_iterator* iter); // Adds an association between a field and a type to |field_type_map|. - static bool Add(FieldTypeMap* field_type_map, AutoFillField* field, + static bool Add(FieldTypeMap* field_type_map, AutofillField* field, const AutoFillType& type); protected: @@ -135,18 +135,18 @@ class FormField { char pattern_operator); private: - static bool ParseText(std::vector<AutoFillField*>::const_iterator* iter, + static bool ParseText(std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest, + AutofillField** dest, bool match_label_only); // For empty strings we need to test that both label and name are empty. static bool ParseLabelAndName( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, const string16& pattern, - AutoFillField** dest); - static bool MatchName(AutoFillField* field, const string16& pattern); - static bool MatchLabel(AutoFillField* field, const string16& pattern); + AutofillField** dest); + static bool MatchName(AutofillField* field, const string16& pattern); + static bool MatchLabel(AutofillField* field, const string16& pattern); DISALLOW_COPY_AND_ASSIGN(FormField); }; diff --git a/chrome/browser/autofill/form_field_unittest.cc b/chrome/browser/autofill/form_field_unittest.cc index 965fa70..ef68eb8 100644 --- a/chrome/browser/autofill/form_field_unittest.cc +++ b/chrome/browser/autofill/form_field_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ namespace { TEST(FormFieldTest, Match) { - AutoFillField field; + AutofillField field; // Empty strings match. EXPECT_TRUE(FormField::Match(&field, string16(), true)); diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc index acfa1e4..539c124 100644 --- a/chrome/browser/autofill/form_structure.cc +++ b/chrome/browser/autofill/form_structure.cc @@ -63,7 +63,7 @@ FormStructure::FormStructure(const FormData& form) // Generate a unique name for this field by appending a counter to the name. string16 unique_name = field->name() + base::IntToString16(fields_.size() + 1); - fields_.push_back(new AutoFillField(*field, unique_name)); + fields_.push_back(new AutofillField(*field, unique_name)); } // Terminate the vector with a NULL item. @@ -199,9 +199,9 @@ void FormStructure::ParseQueryResponse(const std::string& response_xml, form->has_credit_card_field_ = false; form->has_autofillable_field_ = false; - for (std::vector<AutoFillField*>::iterator field = form->fields_.begin(); + for (std::vector<AutofillField*>::iterator field = form->fields_.begin(); field != form->fields_.end(); ++field, ++current_type) { - // The field list is terminated by a NULL AutoFillField. + // The field list is terminated by a NULL AutofillField. if (!*field) break; @@ -270,9 +270,9 @@ bool FormStructure::HasAutoFillableValues() const { if (autofill_count_ == 0) return false; - for (std::vector<AutoFillField*>::const_iterator iter = begin(); + for (std::vector<AutofillField*>::const_iterator iter = begin(); iter != end(); ++iter) { - AutoFillField* field = *iter; + AutofillField* field = *iter; if (field && !field->IsEmpty() && field->IsFieldFillable()) return true; } @@ -282,9 +282,9 @@ bool FormStructure::HasAutoFillableValues() const { void FormStructure::UpdateAutoFillCount() { autofill_count_ = 0; - for (std::vector<AutoFillField*>::const_iterator iter = begin(); + for (std::vector<AutofillField*>::const_iterator iter = begin(); iter != end(); ++iter) { - AutoFillField* field = *iter; + AutofillField* field = *iter; if (field && field->IsFieldFillable()) ++autofill_count_; } @@ -310,7 +310,7 @@ void FormStructure::set_possible_types(int index, const FieldTypeSet& types) { fields_[index]->set_possible_types(types); } -const AutoFillField* FormStructure::field(int index) const { +const AutofillField* FormStructure::field(int index) const { return fields_[index]; } @@ -366,7 +366,7 @@ void FormStructure::GetHeuristicAutoFillTypes() { GetHeuristicFieldInfo(&field_type_map); for (size_t index = 0; index < field_count(); index++) { - AutoFillField* field = fields_[index]; + AutofillField* field = fields_[index]; DCHECK(field); FieldTypeMap::iterator iter = field_type_map.find(field->unique_name()); @@ -414,7 +414,7 @@ bool FormStructure::EncodeFormRequest( // Add the child nodes for the form fields. for (size_t index = 0; index < field_count(); ++index) { - const AutoFillField* field = fields_[index]; + const AutofillField* field = fields_[index]; if (request_type == FormStructure::UPLOAD) { FieldTypeSet types = field->possible_types(); // |types| could be empty in unit-tests only. @@ -450,7 +450,7 @@ std::string FormStructure::ConvertPresenceBitsToString() const { presence_bitfield[i] = 0; for (size_t i = 0; i < field_count(); ++i) { - const AutoFillField* field = fields_[i]; + const AutofillField* field = fields_[i]; FieldTypeSet types = field->possible_types(); // |types| could be empty in unit-tests only. for (FieldTypeSet::iterator field_type = types.begin(); diff --git a/chrome/browser/autofill/form_structure.h b/chrome/browser/autofill/form_structure.h index 0136ed5..664b181 100644 --- a/chrome/browser/autofill/form_structure.h +++ b/chrome/browser/autofill/form_structure.h @@ -86,17 +86,17 @@ class FormStructure { // Sets the possible types for the field at |index|. void set_possible_types(int index, const FieldTypeSet& types); - const AutoFillField* field(int index) const; + const AutofillField* field(int index) const; size_t field_count() const; // Returns the number of fields that are able to be autofilled. size_t autofill_count() const { return autofill_count_; } // Used for iterating over the fields. - std::vector<AutoFillField*>::const_iterator begin() const { + std::vector<AutofillField*>::const_iterator begin() const { return fields_.begin(); } - std::vector<AutoFillField*>::const_iterator end() const { + std::vector<AutofillField*>::const_iterator end() const { return fields_.end(); } @@ -109,7 +109,7 @@ class FormStructure { protected: // For tests. - ScopedVector<AutoFillField>* fields() { return &fields_; } + ScopedVector<AutofillField>* fields() { return &fields_; } private: friend class FormStructureTest; @@ -155,7 +155,7 @@ class FormStructure { // A vector of all the input fields in the form. The vector is terminated by // a NULL entry. - ScopedVector<AutoFillField> fields_; + ScopedVector<AutofillField> fields_; // The names of the form input elements, that are part of the form signature. // The string starts with "&" and the names are also separated by the "&" diff --git a/chrome/browser/autofill/form_structure_browsertest.cc b/chrome/browser/autofill/form_structure_browsertest.cc index de636a4..9f06b99 100644 --- a/chrome/browser/autofill/form_structure_browsertest.cc +++ b/chrome/browser/autofill/form_structure_browsertest.cc @@ -73,7 +73,7 @@ std::string FormStructureBrowserTest::FormStructuresToString( iter != forms.end(); ++iter) { - for (std::vector<AutoFillField*>::const_iterator field_iter = + for (std::vector<AutofillField*>::const_iterator field_iter = (*iter)->begin(); field_iter != (*iter)->end(); ++field_iter) { diff --git a/chrome/browser/autofill/name_field.cc b/chrome/browser/autofill/name_field.cc index 11cd534..5fa49cd 100644 --- a/chrome/browser/autofill/name_field.cc +++ b/chrome/browser/autofill/name_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,7 +12,7 @@ #include "grit/autofill_resources.h" #include "ui/base/l10n/l10n_util.h" -NameField* NameField::Parse(std::vector<AutoFillField*>::const_iterator* iter, +NameField* NameField::Parse(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml) { // Try FirstLastNameField first since it's more specific. NameField* field = FirstLastNameField::Parse(iter, is_ecml); @@ -28,10 +28,10 @@ bool FullNameField::GetFieldInfo(FieldTypeMap* field_type_map) const { } FullNameField* FullNameField::Parse( - std::vector<AutoFillField*>::const_iterator* iter) { + std::vector<AutofillField*>::const_iterator* iter) { // Exclude labels containing the string "username", which typically // denotes a login ID rather than the user's actual name. - AutoFillField* field = **iter; + AutofillField* field = **iter; if (Match(field, l10n_util::GetStringUTF16(IDS_AUTOFILL_USERNAME_RE), false)) return NULL; @@ -45,18 +45,18 @@ FullNameField* FullNameField::Parse( return NULL; } -FullNameField::FullNameField(AutoFillField* field) +FullNameField::FullNameField(AutofillField* field) : field_(field) { } FirstLastNameField* FirstLastNameField::Parse1( - std::vector<AutoFillField*>::const_iterator* iter) { + std::vector<AutofillField*>::const_iterator* iter) { // Some pages (e.g. Overstock_comBilling.html, SmithsonianCheckout.html) // have the label "Name" followed by two or three text fields. scoped_ptr<FirstLastNameField> v(new FirstLastNameField); - std::vector<AutoFillField*>::const_iterator q = *iter; + std::vector<AutofillField*>::const_iterator q = *iter; - AutoFillField* next; + AutofillField* next; if (ParseText(&q, l10n_util::GetStringUTF16(IDS_AUTOFILL_NAME_SPECIFIC_RE), &v->first_name_) && @@ -78,9 +78,9 @@ FirstLastNameField* FirstLastNameField::Parse1( } FirstLastNameField* FirstLastNameField::Parse2( - std::vector<AutoFillField*>::const_iterator* iter) { + std::vector<AutofillField*>::const_iterator* iter) { scoped_ptr<FirstLastNameField> v(new FirstLastNameField); - std::vector<AutoFillField*>::const_iterator q = *iter; + std::vector<AutofillField*>::const_iterator q = *iter; // A fair number of pages use the names "fname" and "lname" for naming // first and last name fields (examples from the test suite: @@ -117,9 +117,9 @@ FirstLastNameField* FirstLastNameField::Parse2( } FirstLastNameField* FirstLastNameField::ParseEcmlName( - std::vector<AutoFillField*>::const_iterator* iter) { + std::vector<AutofillField*>::const_iterator* iter) { scoped_ptr<FirstLastNameField> field(new FirstLastNameField); - std::vector<AutoFillField*>::const_iterator q = *iter; + std::vector<AutofillField*>::const_iterator q = *iter; string16 pattern = GetEcmlPattern(kEcmlShipToFirstName, kEcmlBillToFirstName, '|'); @@ -139,7 +139,7 @@ FirstLastNameField* FirstLastNameField::ParseEcmlName( } FirstLastNameField* FirstLastNameField::Parse( - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml) { if (is_ecml) { return ParseEcmlName(iter); diff --git a/chrome/browser/autofill/name_field.h b/chrome/browser/autofill/name_field.h index 0c6bd09..2625ae1 100644 --- a/chrome/browser/autofill/name_field.h +++ b/chrome/browser/autofill/name_field.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,7 +14,7 @@ // A form field that can parse either a FullNameField or a FirstLastNameField. class NameField : public FormField { public: - static NameField* Parse(std::vector<AutoFillField*>::const_iterator* iter, + static NameField* Parse(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml); protected: @@ -30,12 +30,12 @@ class FullNameField : public NameField { virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const; static FullNameField* Parse( - std::vector<AutoFillField*>::const_iterator* iter); + std::vector<AutofillField*>::const_iterator* iter); private: - explicit FullNameField(AutoFillField* field); + explicit FullNameField(AutofillField* field); - AutoFillField* field_; + AutofillField* field_; DISALLOW_COPY_AND_ASSIGN(FullNameField); }; @@ -43,22 +43,22 @@ class FullNameField : public NameField { class FirstLastNameField : public NameField { public: static FirstLastNameField* Parse1( - std::vector<AutoFillField*>::const_iterator* iter); + std::vector<AutofillField*>::const_iterator* iter); static FirstLastNameField* Parse2( - std::vector<AutoFillField*>::const_iterator* iter); + std::vector<AutofillField*>::const_iterator* iter); static FirstLastNameField* ParseEcmlName( - std::vector<AutoFillField*>::const_iterator* iter); + std::vector<AutofillField*>::const_iterator* iter); static FirstLastNameField* Parse( - std::vector<AutoFillField*>::const_iterator* iter, bool is_ecml); + std::vector<AutofillField*>::const_iterator* iter, bool is_ecml); virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const; private: FirstLastNameField(); - AutoFillField* first_name_; - AutoFillField* middle_name_; // Optional. - AutoFillField* last_name_; + AutofillField* first_name_; + AutofillField* middle_name_; // Optional. + AutofillField* last_name_; bool middle_initial_; // True if middle_name_ is a middle initial. DISALLOW_COPY_AND_ASSIGN(FirstLastNameField); diff --git a/chrome/browser/autofill/name_field_unittest.cc b/chrome/browser/autofill/name_field_unittest.cc index ce64c5f..2e29187 100644 --- a/chrome/browser/autofill/name_field_unittest.cc +++ b/chrome/browser/autofill/name_field_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,10 +17,10 @@ class NameFieldTest : public testing::Test { NameFieldTest() {} protected: - ScopedVector<AutoFillField> list_; + ScopedVector<AutofillField> list_; scoped_ptr<NameField> field_; FieldTypeMap field_type_map_; - std::vector<AutoFillField*>::const_iterator iter_; + std::vector<AutofillField*>::const_iterator iter_; private: DISALLOW_COPY_AND_ASSIGN(NameFieldTest); @@ -28,7 +28,7 @@ class NameFieldTest : public testing::Test { TEST_F(NameFieldTest, FirstMiddleLast) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), ASCIIToUTF16("First"), string16(), ASCIIToUTF16("text"), @@ -36,7 +36,7 @@ TEST_F(NameFieldTest, FirstMiddleLast) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Middle Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Middle Name"), ASCIIToUTF16("Middle"), string16(), ASCIIToUTF16("text"), @@ -44,7 +44,7 @@ TEST_F(NameFieldTest, FirstMiddleLast) { false), ASCIIToUTF16("name2"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Last Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Last Name"), ASCIIToUTF16("Last"), string16(), ASCIIToUTF16("text"), @@ -69,7 +69,7 @@ TEST_F(NameFieldTest, FirstMiddleLast) { TEST_F(NameFieldTest, FirstMiddleLast2) { list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("firstName"), string16(), ASCIIToUTF16("text"), @@ -77,7 +77,7 @@ TEST_F(NameFieldTest, FirstMiddleLast2) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("middleName"), string16(), ASCIIToUTF16("text"), @@ -85,7 +85,7 @@ TEST_F(NameFieldTest, FirstMiddleLast2) { false), ASCIIToUTF16("name2"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("lastName"), string16(), ASCIIToUTF16("text"), @@ -110,7 +110,7 @@ TEST_F(NameFieldTest, FirstMiddleLast2) { TEST_F(NameFieldTest, FirstLast) { list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("first_name"), string16(), ASCIIToUTF16("text"), @@ -118,7 +118,7 @@ TEST_F(NameFieldTest, FirstLast) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("last_name"), string16(), ASCIIToUTF16("text"), @@ -140,7 +140,7 @@ TEST_F(NameFieldTest, FirstLast) { TEST_F(NameFieldTest, FirstLast2) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name"), ASCIIToUTF16("first_name"), string16(), ASCIIToUTF16("text"), @@ -148,7 +148,7 @@ TEST_F(NameFieldTest, FirstLast2) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name"), ASCIIToUTF16("last_name"), string16(), ASCIIToUTF16("text"), @@ -170,7 +170,7 @@ TEST_F(NameFieldTest, FirstLast2) { TEST_F(NameFieldTest, FirstLastMiddleWithSpaces) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), ASCIIToUTF16("first name"), string16(), ASCIIToUTF16("text"), @@ -178,7 +178,7 @@ TEST_F(NameFieldTest, FirstLastMiddleWithSpaces) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Middle Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Middle Name"), ASCIIToUTF16("middle name"), string16(), ASCIIToUTF16("text"), @@ -186,7 +186,7 @@ TEST_F(NameFieldTest, FirstLastMiddleWithSpaces) { false), ASCIIToUTF16("name2"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Last Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Last Name"), ASCIIToUTF16("last name"), string16(), ASCIIToUTF16("text"), @@ -211,7 +211,7 @@ TEST_F(NameFieldTest, FirstLastMiddleWithSpaces) { TEST_F(NameFieldTest, FirstLastEmpty) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name"), ASCIIToUTF16("first_name"), string16(), ASCIIToUTF16("text"), @@ -219,7 +219,7 @@ TEST_F(NameFieldTest, FirstLastEmpty) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("last_name"), string16(), ASCIIToUTF16("text"), @@ -241,7 +241,7 @@ TEST_F(NameFieldTest, FirstLastEmpty) { TEST_F(NameFieldTest, FirstMiddleLastEmpty) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Name"), ASCIIToUTF16("first_name"), string16(), ASCIIToUTF16("text"), @@ -249,7 +249,7 @@ TEST_F(NameFieldTest, FirstMiddleLastEmpty) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("middle_name"), string16(), ASCIIToUTF16("text"), @@ -257,7 +257,7 @@ TEST_F(NameFieldTest, FirstMiddleLastEmpty) { false), ASCIIToUTF16("name2"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("last_name"), string16(), ASCIIToUTF16("text"), @@ -282,7 +282,7 @@ TEST_F(NameFieldTest, FirstMiddleLastEmpty) { TEST_F(NameFieldTest, MiddleInitial) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), ASCIIToUTF16("first_name"), string16(), ASCIIToUTF16("text"), @@ -290,7 +290,7 @@ TEST_F(NameFieldTest, MiddleInitial) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("MI"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("MI"), ASCIIToUTF16("middle_name"), string16(), ASCIIToUTF16("text"), @@ -298,7 +298,7 @@ TEST_F(NameFieldTest, MiddleInitial) { false), ASCIIToUTF16("name2"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Last Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Last Name"), ASCIIToUTF16("last_name"), string16(), ASCIIToUTF16("text"), @@ -323,7 +323,7 @@ TEST_F(NameFieldTest, MiddleInitial) { TEST_F(NameFieldTest, MiddleInitialNoLastName) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("First Name"), ASCIIToUTF16("first_name"), string16(), ASCIIToUTF16("text"), @@ -331,7 +331,7 @@ TEST_F(NameFieldTest, MiddleInitialNoLastName) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("MI"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("MI"), ASCIIToUTF16("middle_name"), string16(), ASCIIToUTF16("text"), @@ -348,7 +348,7 @@ TEST_F(NameFieldTest, MiddleInitialNoLastName) { // came at the end following other descriptive text. http://crbug.com/45123. TEST_F(NameFieldTest, MiddleInitialAtEnd) { list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("XXXnameXXXfirst"), string16(), ASCIIToUTF16("text"), @@ -356,7 +356,7 @@ TEST_F(NameFieldTest, MiddleInitialAtEnd) { false), ASCIIToUTF16("name1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("XXXnameXXXmi"), string16(), ASCIIToUTF16("text"), @@ -364,7 +364,7 @@ TEST_F(NameFieldTest, MiddleInitialAtEnd) { false), ASCIIToUTF16("name2"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("XXXnameXXXlast"), string16(), ASCIIToUTF16("text"), @@ -388,7 +388,7 @@ TEST_F(NameFieldTest, MiddleInitialAtEnd) { } TEST_F(NameFieldTest, ECMLNoName) { - list_.push_back(new AutoFillField( + list_.push_back(new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Company"), ASCIIToUTF16("ecom_shipto_postal_company"), string16(), @@ -403,7 +403,7 @@ TEST_F(NameFieldTest, ECMLNoName) { } TEST_F(NameFieldTest, ECMLMiddleInitialNoLastName) { - list_.push_back(new AutoFillField( + list_.push_back(new AutofillField( webkit_glue::FormField(ASCIIToUTF16("First Name"), ASCIIToUTF16("ecom_shipto_postal_name_first"), string16(), @@ -411,7 +411,7 @@ TEST_F(NameFieldTest, ECMLMiddleInitialNoLastName) { 0, false), ASCIIToUTF16("name1"))); - list_.push_back(new AutoFillField( + list_.push_back(new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Middle"), ASCIIToUTF16("ecom_shipto_postal_name_middle"), string16(), @@ -426,7 +426,7 @@ TEST_F(NameFieldTest, ECMLMiddleInitialNoLastName) { } TEST_F(NameFieldTest, ECMLFirstMiddleLast) { - list_.push_back(new AutoFillField( + list_.push_back(new AutofillField( webkit_glue::FormField(string16(), ASCIIToUTF16("ecom_shipto_postal_name_first"), string16(), @@ -434,7 +434,7 @@ TEST_F(NameFieldTest, ECMLFirstMiddleLast) { 0, false), ASCIIToUTF16("name1"))); - list_.push_back(new AutoFillField( + list_.push_back(new AutofillField( webkit_glue::FormField(string16(), ASCIIToUTF16("ecom_shipto_postal_name_middle"), string16(), @@ -442,7 +442,7 @@ TEST_F(NameFieldTest, ECMLFirstMiddleLast) { 0, false), ASCIIToUTF16("name2"))); - list_.push_back(new AutoFillField( + list_.push_back(new AutofillField( webkit_glue::FormField(string16(), ASCIIToUTF16("ecom_shipto_postal_name_last"), string16(), diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc index 607d5ad..579edd8 100644 --- a/chrome/browser/autofill/personal_data_manager.cc +++ b/chrome/browser/autofill/personal_data_manager.cc @@ -10,14 +10,14 @@ #include "base/logging.h" #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/autofill/autofill_field.h" #include "chrome/browser/autofill/autofill-inl.h" +#include "chrome/browser/autofill/autofill_field.h" #include "chrome/browser/autofill/autofill_metrics.h" #include "chrome/browser/autofill/form_structure.h" #include "chrome/browser/autofill/phone_number.h" +#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/webdata/web_data_service.h" -#include "chrome/browser/prefs/pref_service.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebRegularExpression.h" @@ -181,7 +181,7 @@ bool PersonalDataManager::ImportFormData( for (iter = form_structures.begin(); iter != form_structures.end(); ++iter) { const FormStructure* form = *iter; for (size_t i = 0; i < form->field_count(); ++i) { - const AutoFillField* field = form->field(i); + const AutofillField* field = form->field(i); string16 value = CollapseWhitespace(field->value(), false); // If we don't know the type of the field, or the user hasn't entered any diff --git a/chrome/browser/autofill/phone_field.cc b/chrome/browser/autofill/phone_field.cc index e2bfde0..2679abe 100644 --- a/chrome/browser/autofill/phone_field.cc +++ b/chrome/browser/autofill/phone_field.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -97,7 +97,7 @@ PhoneField::Parser PhoneField::phone_field_grammars_[] = { PhoneField::~PhoneField() {} // static -PhoneField* PhoneField::Parse(std::vector<AutoFillField*>::const_iterator* iter, +PhoneField* PhoneField::Parse(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml) { DCHECK(iter); if (!iter) @@ -122,10 +122,10 @@ PhoneField* PhoneField::Parse(std::vector<AutoFillField*>::const_iterator* iter, // static PhoneField* PhoneField::ParseECML( - std::vector<AutoFillField*>::const_iterator* iter) { + std::vector<AutofillField*>::const_iterator* iter) { string16 pattern(GetEcmlPattern(kEcmlShipToPhone, kEcmlBillToPhone, '|')); - AutoFillField* field; + AutofillField* field; if (ParseText(iter, pattern, &field)) { PhoneField* phone_field = new PhoneField(); phone_field->parsed_phone_fields_[FIELD_PHONE] = field; @@ -258,7 +258,7 @@ string16 PhoneField::GetRegExp(RegexType regex_id) const { // static bool PhoneField::ParseInternal( PhoneField *phone_field, - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool regular_phone) { DCHECK(iter); @@ -266,10 +266,10 @@ bool PhoneField::ParseInternal( if (!phone_field) return false; - std::vector<AutoFillField*>::const_iterator q = *iter; + std::vector<AutofillField*>::const_iterator q = *iter; // The form owns the following variables, so they should not be deleted. - AutoFillField* parsed_fields[FIELD_MAX]; + AutofillField* parsed_fields[FIELD_MAX]; for (size_t i = 0; i < arraysize(phone_field_grammars_); ++i) { memset(parsed_fields, 0, sizeof(parsed_fields)); diff --git a/chrome/browser/autofill/phone_field.h b/chrome/browser/autofill/phone_field.h index ab48a116..97b6f8b 100644 --- a/chrome/browser/autofill/phone_field.h +++ b/chrome/browser/autofill/phone_field.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,7 +13,7 @@ #include "chrome/browser/autofill/form_field.h" #include "chrome/browser/autofill/phone_number.h" -class AutoFillField; +class AutofillField; // A phone number in one of the following formats: // - area code, prefix, suffix @@ -23,10 +23,10 @@ class PhoneField : public FormField { public: virtual ~PhoneField(); - static PhoneField* Parse(std::vector<AutoFillField*>::const_iterator* iter, + static PhoneField* Parse(std::vector<AutofillField*>::const_iterator* iter, bool is_ecml); static PhoneField* ParseECML( - std::vector<AutoFillField*>::const_iterator* iter); + std::vector<AutofillField*>::const_iterator* iter); virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const; @@ -83,7 +83,7 @@ class PhoneField : public FormField { // |regular_phone| - true if the parsed phone is a HOME phone, false // otherwise. static bool ParseInternal(PhoneField* field, - std::vector<AutoFillField*>::const_iterator* iter, + std::vector<AutofillField*>::const_iterator* iter, bool regular_phone); void SetPhoneType(PhoneType phone_type); @@ -108,7 +108,7 @@ class PhoneField : public FormField { // FIELD_PHONE is always present; holds suffix if prefix is present. // The rest could be NULL. - AutoFillField* parsed_phone_fields_[FIELD_MAX]; + AutofillField* parsed_phone_fields_[FIELD_MAX]; static struct Parser { RegexType regex; // Field matching reg-ex. diff --git a/chrome/browser/autofill/phone_field_unittest.cc b/chrome/browser/autofill/phone_field_unittest.cc index 912b5d8..3661146 100644 --- a/chrome/browser/autofill/phone_field_unittest.cc +++ b/chrome/browser/autofill/phone_field_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,10 +16,10 @@ class PhoneFieldTest : public testing::Test { PhoneFieldTest() {} protected: - ScopedVector<AutoFillField> list_; + ScopedVector<AutofillField> list_; scoped_ptr<PhoneField> field_; FieldTypeMap field_type_map_; - std::vector<AutoFillField*>::const_iterator iter_; + std::vector<AutofillField*>::const_iterator iter_; private: DISALLOW_COPY_AND_ASSIGN(PhoneFieldTest); @@ -33,7 +33,7 @@ TEST_F(PhoneFieldTest, Empty) { } TEST_F(PhoneFieldTest, NonParse) { - list_.push_back(new AutoFillField); + list_.push_back(new AutofillField); list_.push_back(NULL); iter_ = list_.begin(); field_.reset(PhoneField::Parse(&iter_, false)); @@ -42,7 +42,7 @@ TEST_F(PhoneFieldTest, NonParse) { TEST_F(PhoneFieldTest, ParseOneLinePhone) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), ASCIIToUTF16("phone"), string16(), ASCIIToUTF16("text"), @@ -61,7 +61,7 @@ TEST_F(PhoneFieldTest, ParseOneLinePhone) { TEST_F(PhoneFieldTest, ParseOneLinePhoneEcml) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), ASCIIToUTF16(kEcmlShipToPhone), string16(), ASCIIToUTF16("text"), @@ -80,7 +80,7 @@ TEST_F(PhoneFieldTest, ParseOneLinePhoneEcml) { TEST_F(PhoneFieldTest, ParseTwoLinePhone) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Area Code"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Area Code"), ASCIIToUTF16("area code"), string16(), ASCIIToUTF16("text"), @@ -88,7 +88,7 @@ TEST_F(PhoneFieldTest, ParseTwoLinePhone) { false), ASCIIToUTF16("areacode1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), ASCIIToUTF16("phone"), string16(), ASCIIToUTF16("text"), @@ -110,7 +110,7 @@ TEST_F(PhoneFieldTest, ParseTwoLinePhone) { TEST_F(PhoneFieldTest, ParseTwoLinePhoneEcmlShipTo) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Area Code"), ASCIIToUTF16(kEcmlShipToPostalCode), string16(), @@ -119,7 +119,7 @@ TEST_F(PhoneFieldTest, ParseTwoLinePhoneEcmlShipTo) { false), ASCIIToUTF16("areacode1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), ASCIIToUTF16(kEcmlShipToPhone), string16(), ASCIIToUTF16("text"), @@ -141,7 +141,7 @@ TEST_F(PhoneFieldTest, ParseTwoLinePhoneEcmlShipTo) { TEST_F(PhoneFieldTest, ParseTwoLinePhoneEcmlBillTo) { list_.push_back( - new AutoFillField( + new AutofillField( webkit_glue::FormField(ASCIIToUTF16("Area Code"), ASCIIToUTF16(kEcmlBillToPostalCode), string16(), @@ -150,7 +150,7 @@ TEST_F(PhoneFieldTest, ParseTwoLinePhoneEcmlBillTo) { false), ASCIIToUTF16("areacode1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Phone"), ASCIIToUTF16(kEcmlBillToPhone), string16(), ASCIIToUTF16("text"), @@ -177,7 +177,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumber) { // size: <prefix> is no bigger than 3 characters, and <suffix> is no bigger // than 4. list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Phone:"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Phone:"), ASCIIToUTF16("dayphone1"), string16(), ASCIIToUTF16("text"), @@ -185,7 +185,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumber) { false), ASCIIToUTF16("areacode1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("-"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("-"), ASCIIToUTF16("dayphone2"), string16(), ASCIIToUTF16("text"), @@ -193,7 +193,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumber) { false), ASCIIToUTF16("prefix1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("-"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("-"), ASCIIToUTF16("dayphone3"), string16(), ASCIIToUTF16("text"), @@ -201,7 +201,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumber) { false), ASCIIToUTF16("suffix1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("ext.:"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("ext.:"), ASCIIToUTF16("dayphone4"), string16(), ASCIIToUTF16("text"), @@ -229,7 +229,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumber) { // https://www.wrapables.com/jsp/Signup.jsp. TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Phone:"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Phone:"), ASCIIToUTF16("area"), string16(), ASCIIToUTF16("text"), @@ -237,7 +237,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix) { false), ASCIIToUTF16("areacode1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("prefix"), string16(), ASCIIToUTF16("text"), @@ -245,7 +245,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix) { false), ASCIIToUTF16("prefix1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("suffix"), string16(), ASCIIToUTF16("text"), @@ -270,7 +270,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix) { TEST_F(PhoneFieldTest, ParseOneLineFax) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Fax"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Fax"), ASCIIToUTF16("fax"), string16(), ASCIIToUTF16("text"), @@ -289,7 +289,7 @@ TEST_F(PhoneFieldTest, ParseOneLineFax) { TEST_F(PhoneFieldTest, ParseTwoLineFax) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Area Code"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Area Code"), ASCIIToUTF16("area code"), string16(), ASCIIToUTF16("text"), @@ -297,7 +297,7 @@ TEST_F(PhoneFieldTest, ParseTwoLineFax) { false), ASCIIToUTF16("areacode1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Fax"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Fax"), ASCIIToUTF16("fax"), string16(), ASCIIToUTF16("text"), @@ -320,7 +320,7 @@ TEST_F(PhoneFieldTest, ParseTwoLineFax) { TEST_F(PhoneFieldTest, ThreePartFaxNumberPrefixSuffix) { list_.push_back( - new AutoFillField(webkit_glue::FormField(ASCIIToUTF16("Fax:"), + new AutofillField(webkit_glue::FormField(ASCIIToUTF16("Fax:"), ASCIIToUTF16("area"), string16(), ASCIIToUTF16("text"), @@ -328,7 +328,7 @@ TEST_F(PhoneFieldTest, ThreePartFaxNumberPrefixSuffix) { false), ASCIIToUTF16("areacode1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("prefix"), string16(), ASCIIToUTF16("text"), @@ -336,7 +336,7 @@ TEST_F(PhoneFieldTest, ThreePartFaxNumberPrefixSuffix) { false), ASCIIToUTF16("prefix1"))); list_.push_back( - new AutoFillField(webkit_glue::FormField(string16(), + new AutofillField(webkit_glue::FormField(string16(), ASCIIToUTF16("suffix"), string16(), ASCIIToUTF16("text"), diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index b0dcbdf..bc2bfe2 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -4237,7 +4237,7 @@ ListValue* TestingAutomationProvider::GetListFromAutoFillProfiles( ListValue* profiles = new ListValue; std::map<AutofillFieldType, std::string> autofill_type_to_string - = GetAutoFillFieldToStringMap(); + = GetAutofillFieldToStringMap(); // For each AutoFillProfile, transform it to a dictionary object to return. for (std::vector<AutoFillProfile*>::const_iterator it = @@ -4297,7 +4297,7 @@ TestingAutomationProvider::GetAutoFillProfilesFromList( string16 current_value; std::map<AutofillFieldType, std::string> autofill_type_to_string = - GetAutoFillFieldToStringMap(); + GetAutofillFieldToStringMap(); int num_profiles = profiles.GetSize(); for (int i = 0; i < num_profiles; i++) { @@ -4356,7 +4356,7 @@ std::vector<CreditCard> TestingAutomationProvider::GetCreditCardsFromList( /* static */ std::map<AutofillFieldType, std::string> - TestingAutomationProvider::GetAutoFillFieldToStringMap() { + TestingAutomationProvider::GetAutofillFieldToStringMap() { std::map<AutofillFieldType, std::string> autofill_type_to_string; autofill_type_to_string[NAME_FIRST] = "NAME_FIRST"; autofill_type_to_string[NAME_MIDDLE] = "NAME_MIDDLE"; @@ -4772,8 +4772,7 @@ void TestingAutomationProvider::SetNTPMenuMode( section = MENU_THUMB; } else if (section_name.compare("recently_closed") == 0) { section = MENU_RECENT; - } - else { + } else { reply.SendError(StringPrintf("Unexpected section name: '%s'", section_name.c_str())); return; diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h index 5828447..8233eb9 100644 --- a/chrome/browser/automation/testing_automation_provider.h +++ b/chrome/browser/automation/testing_automation_provider.h @@ -705,7 +705,7 @@ class TestingAutomationProvider : public AutomationProvider, // Return the map from the internal data representation to the string value // of auto fill fields and credit card fields. static std::map<AutofillFieldType, std::string> - GetAutoFillFieldToStringMap(); + GetAutofillFieldToStringMap(); static std::map<AutofillFieldType, std::string> GetCreditCardFieldToStringMap(); |