summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-10 12:29:21 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-10 12:29:21 +0000
commite90c2256aed9c209b5a1cc5db4ef0975ab64490b (patch)
tree486c9924987a95ac33a0dc4f6054a678b717ef7c /chrome/browser/webdata
parent987d99ce11821cfd4af42b3a718d1dbfe8587817 (diff)
downloadchromium_src-e90c2256aed9c209b5a1cc5db4ef0975ab64490b.zip
chromium_src-e90c2256aed9c209b5a1cc5db4ef0975ab64490b.tar.gz
chromium_src-e90c2256aed9c209b5a1cc5db4ef0975ab64490b.tar.bz2
autofill: Rename AutoFillProfile to AutofillProfile.
BUG=72758 TEST=existing unit_tests Review URL: http://codereview.chromium.org/6658030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata')
-rw-r--r--chrome/browser/webdata/autofill_change.cc2
-rw-r--r--chrome/browser/webdata/autofill_change.h10
-rw-r--r--chrome/browser/webdata/web_data_service.cc78
-rw-r--r--chrome/browser/webdata/web_data_service.h26
-rw-r--r--chrome/browser/webdata/web_data_service_unittest.cc42
-rw-r--r--chrome/browser/webdata/web_database.cc122
-rw-r--r--chrome/browser/webdata/web_database.h28
-rw-r--r--chrome/browser/webdata/web_database_unittest.cc78
8 files changed, 193 insertions, 193 deletions
diff --git a/chrome/browser/webdata/autofill_change.cc b/chrome/browser/webdata/autofill_change.cc
index e78a4ab..454d7b9 100644
--- a/chrome/browser/webdata/autofill_change.cc
+++ b/chrome/browser/webdata/autofill_change.cc
@@ -15,7 +15,7 @@ AutofillChange::~AutofillChange() {
}
AutofillProfileChange::AutofillProfileChange(
- Type type, std::string key, const AutoFillProfile* profile)
+ Type type, std::string key, const AutofillProfile* profile)
: GenericAutofillChange<std::string>(type, key),
profile_(profile) {
DCHECK(type == ADD ? (profile && profile->guid() == key) : true);
diff --git a/chrome/browser/webdata/autofill_change.h b/chrome/browser/webdata/autofill_change.h
index 1c7449e..37ad33f 100644
--- a/chrome/browser/webdata/autofill_change.h
+++ b/chrome/browser/webdata/autofill_change.h
@@ -8,11 +8,11 @@
#include "chrome/browser/webdata/autofill_entry.h"
-class AutoFillProfile;
+class AutofillProfile;
class CreditCard;
// For classic Autofill form fields, the KeyType is AutofillKey.
-// Autofill++ types such as AutoFillProfile and CreditCard simply use an int.
+// Autofill++ types such as AutofillProfile and CreditCard simply use an int.
template <typename KeyType>
class GenericAutofillChange {
public:
@@ -55,15 +55,15 @@ class AutofillProfileChange : public GenericAutofillChange<std::string> {
// When |type| == REMOVE, |profile| should be NULL.
AutofillProfileChange(Type type,
std::string key,
- const AutoFillProfile* profile);
+ const AutofillProfile* profile);
virtual ~AutofillProfileChange();
- const AutoFillProfile* profile() const { return profile_; }
+ const AutofillProfile* profile() const { return profile_; }
bool operator==(const AutofillProfileChange& change) const;
private:
// Weak reference, can be NULL.
- const AutoFillProfile* profile_;
+ const AutofillProfile* profile_;
};
// Change notification details for AutoFill credit card changes.
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index f75a47a..21f8ee1 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -391,44 +391,44 @@ void WebDataService::RemoveFormValueForElementName(
request));
}
-void WebDataService::AddAutoFillProfile(const AutoFillProfile& profile) {
- GenericRequest<AutoFillProfile>* request =
- new GenericRequest<AutoFillProfile>(
+void WebDataService::AddAutofillProfile(const AutofillProfile& profile) {
+ GenericRequest<AutofillProfile>* request =
+ new GenericRequest<AutofillProfile>(
this, GetNextRequestHandle(), NULL, profile);
RegisterRequest(request);
ScheduleTask(NewRunnableMethod(this,
- &WebDataService::AddAutoFillProfileImpl,
+ &WebDataService::AddAutofillProfileImpl,
request));
}
-void WebDataService::UpdateAutoFillProfile(const AutoFillProfile& profile) {
- GenericRequest<AutoFillProfile>* request =
- new GenericRequest<AutoFillProfile>(
+void WebDataService::UpdateAutofillProfile(const AutofillProfile& profile) {
+ GenericRequest<AutofillProfile>* request =
+ new GenericRequest<AutofillProfile>(
this, GetNextRequestHandle(), NULL, profile);
RegisterRequest(request);
ScheduleTask(NewRunnableMethod(this,
- &WebDataService::UpdateAutoFillProfileImpl,
+ &WebDataService::UpdateAutofillProfileImpl,
request));
}
-void WebDataService::RemoveAutoFillProfile(const std::string& guid) {
+void WebDataService::RemoveAutofillProfile(const std::string& guid) {
GenericRequest<std::string>* request =
new GenericRequest<std::string>(
this, GetNextRequestHandle(), NULL, guid);
RegisterRequest(request);
ScheduleTask(NewRunnableMethod(this,
- &WebDataService::RemoveAutoFillProfileImpl,
+ &WebDataService::RemoveAutofillProfileImpl,
request));
}
-WebDataService::Handle WebDataService::GetAutoFillProfiles(
+WebDataService::Handle WebDataService::GetAutofillProfiles(
WebDataServiceConsumer* consumer) {
WebDataRequest* request =
new WebDataRequest(this, GetNextRequestHandle(), consumer);
RegisterRequest(request);
ScheduleTask(
NewRunnableMethod(this,
- &WebDataService::GetAutoFillProfilesImpl,
+ &WebDataService::GetAutofillProfilesImpl,
request));
return request->GetHandle();
}
@@ -475,7 +475,7 @@ WebDataService::Handle WebDataService::GetCreditCards(
return request->GetHandle();
}
-void WebDataService::RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
+void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetween(
const Time& delete_begin,
const Time& delete_end) {
GenericRequest2<Time, Time>* request =
@@ -487,7 +487,7 @@ void WebDataService::RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
RegisterRequest(request);
ScheduleTask(NewRunnableMethod(
this,
- &WebDataService::RemoveAutoFillProfilesAndCreditCardsModifiedBetweenImpl,
+ &WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl,
request));
}
@@ -530,10 +530,10 @@ void WebDataService::RequestCompleted(Handle h) {
WDTypedResult const *result = request->GetResult();
if (result) {
if (result->GetType() == AUTOFILL_PROFILES_RESULT) {
- const WDResult<std::vector<AutoFillProfile*> >* r =
- static_cast<const WDResult<std::vector<AutoFillProfile*> >*>(
+ const WDResult<std::vector<AutofillProfile*> >* r =
+ static_cast<const WDResult<std::vector<AutofillProfile*> >*>(
result);
- std::vector<AutoFillProfile*> profiles = r->GetValue();
+ std::vector<AutofillProfile*> profiles = r->GetValue();
STLDeleteElements(&profiles);
} else if (result->GetType() == AUTOFILL_CREDITCARDS_RESULT) {
const WDResult<std::vector<CreditCard*> >* r =
@@ -991,12 +991,12 @@ void WebDataService::RemoveFormValueForElementNameImpl(
request->RequestComplete();
}
-void WebDataService::AddAutoFillProfileImpl(
- GenericRequest<AutoFillProfile>* request) {
+void WebDataService::AddAutofillProfileImpl(
+ GenericRequest<AutofillProfile>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
- const AutoFillProfile& profile = request->GetArgument();
- if (!db_->AddAutoFillProfile(profile)) {
+ const AutofillProfile& profile = request->GetArgument();
+ if (!db_->AddAutofillProfile(profile)) {
NOTREACHED();
return;
}
@@ -1013,23 +1013,23 @@ void WebDataService::AddAutoFillProfileImpl(
request->RequestComplete();
}
-void WebDataService::UpdateAutoFillProfileImpl(
- GenericRequest<AutoFillProfile>* request) {
+void WebDataService::UpdateAutofillProfileImpl(
+ GenericRequest<AutofillProfile>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
- const AutoFillProfile& profile = request->GetArgument();
+ const AutofillProfile& profile = request->GetArgument();
// Only perform the update if the profile exists. It is currently
// valid to try to update a missing profile. We simply drop the write and
// the caller will detect this on the next refresh.
- AutoFillProfile* original_profile = NULL;
- if (!db_->GetAutoFillProfile(profile.guid(), &original_profile)) {
+ AutofillProfile* original_profile = NULL;
+ if (!db_->GetAutofillProfile(profile.guid(), &original_profile)) {
request->RequestComplete();
return;
}
- scoped_ptr<AutoFillProfile> scoped_profile(original_profile);
+ scoped_ptr<AutofillProfile> scoped_profile(original_profile);
- if (!db_->UpdateAutoFillProfile(profile)) {
+ if (!db_->UpdateAutofillProfile(profile)) {
NOTREACHED();
return;
}
@@ -1046,20 +1046,20 @@ void WebDataService::UpdateAutoFillProfileImpl(
request->RequestComplete();
}
-void WebDataService::RemoveAutoFillProfileImpl(
+void WebDataService::RemoveAutofillProfileImpl(
GenericRequest<std::string>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
std::string guid = request->GetArgument();
- AutoFillProfile* profile = NULL;
- if (!db_->GetAutoFillProfile(guid, &profile)) {
+ AutofillProfile* profile = NULL;
+ if (!db_->GetAutofillProfile(guid, &profile)) {
NOTREACHED();
return;
}
- scoped_ptr<AutoFillProfile> scoped_profile(profile);
+ scoped_ptr<AutofillProfile> scoped_profile(profile);
- if (!db_->RemoveAutoFillProfile(guid)) {
+ if (!db_->RemoveAutofillProfile(guid)) {
NOTREACHED();
return;
}
@@ -1075,13 +1075,13 @@ void WebDataService::RemoveAutoFillProfileImpl(
request->RequestComplete();
}
-void WebDataService::GetAutoFillProfilesImpl(WebDataRequest* request) {
+void WebDataService::GetAutofillProfilesImpl(WebDataRequest* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
- std::vector<AutoFillProfile*> profiles;
- db_->GetAutoFillProfiles(&profiles);
+ std::vector<AutofillProfile*> profiles;
+ db_->GetAutofillProfiles(&profiles);
request->SetResult(
- new WDResult<std::vector<AutoFillProfile*> >(AUTOFILL_PROFILES_RESULT,
+ new WDResult<std::vector<AutofillProfile*> >(AUTOFILL_PROFILES_RESULT,
profiles));
}
request->RequestComplete();
@@ -1175,11 +1175,11 @@ void WebDataService::GetCreditCardsImpl(WebDataRequest* request) {
request->RequestComplete();
}
-void WebDataService::RemoveAutoFillProfilesAndCreditCardsModifiedBetweenImpl(
+void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl(
GenericRequest2<Time, Time>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
- if (db_->RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
+ if (db_->RemoveAutofillProfilesAndCreditCardsModifiedBetween(
request->GetArgument1(),
request->GetArgument2())) {
// Note: It is the caller's responsibility to post notifications for any
diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h
index 8e8b211..2dde084 100644
--- a/chrome/browser/webdata/web_data_service.h
+++ b/chrome/browser/webdata/web_data_service.h
@@ -19,7 +19,7 @@
#include "webkit/glue/form_field.h"
class AutofillChange;
-class AutoFillProfile;
+class AutofillProfile;
class CreditCard;
class GURL;
#if defined(OS_WIN)
@@ -70,8 +70,8 @@ typedef enum {
TOKEN_RESULT, // WDResult<std::vector<std::string>>
AUTOFILL_VALUE_RESULT, // WDResult<std::vector<string16>>
AUTOFILL_CHANGES, // WDResult<std::vector<AutofillChange>>
- AUTOFILL_PROFILE_RESULT, // WDResult<AutoFillProfile>
- AUTOFILL_PROFILES_RESULT, // WDResult<std::vector<AutoFillProfile*>>
+ AUTOFILL_PROFILE_RESULT, // WDResult<AutofillProfile>
+ AUTOFILL_PROFILES_RESULT, // WDResult<std::vector<AutofillProfile*>>
AUTOFILL_CREDITCARD_RESULT, // WDResult<CreditCard>
AUTOFILL_CREDITCARDS_RESULT // WDResult<std::vector<CreditCard*>>
} WDResultType;
@@ -439,20 +439,20 @@ class WebDataService
const string16& value);
// Schedules a task to add an AutoFill profile to the web database.
- void AddAutoFillProfile(const AutoFillProfile& profile);
+ void AddAutofillProfile(const AutofillProfile& profile);
// Schedules a task to update an AutoFill profile in the web database.
- void UpdateAutoFillProfile(const AutoFillProfile& profile);
+ void UpdateAutofillProfile(const AutofillProfile& profile);
// Schedules a task to remove an AutoFill profile from the web database.
// |guid| is the identifer of the profile to remove.
- void RemoveAutoFillProfile(const std::string& guid);
+ void RemoveAutofillProfile(const std::string& guid);
// Initiates the request for all AutoFill profiles. The method
// OnWebDataServiceRequestDone of |consumer| gets called when the request is
// finished, with the profiles included in the argument |result|. The
// consumer owns the profiles.
- Handle GetAutoFillProfiles(WebDataServiceConsumer* consumer);
+ Handle GetAutofillProfiles(WebDataServiceConsumer* consumer);
// Schedules a task to add credit card to the web database.
void AddCreditCard(const CreditCard& credit_card);
@@ -471,7 +471,7 @@ class WebDataService
Handle GetCreditCards(WebDataServiceConsumer* consumer);
// Removes AutoFill records from the database.
- void RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
+ void RemoveAutofillProfilesAndCreditCardsModifiedBetween(
const base::Time& delete_begin,
const base::Time& delete_end);
@@ -599,15 +599,15 @@ class WebDataService
GenericRequest2<base::Time, base::Time>* request);
void RemoveFormValueForElementNameImpl(
GenericRequest2<string16, string16>* request);
- void AddAutoFillProfileImpl(GenericRequest<AutoFillProfile>* request);
- void UpdateAutoFillProfileImpl(GenericRequest<AutoFillProfile>* request);
- void RemoveAutoFillProfileImpl(GenericRequest<std::string>* request);
- void GetAutoFillProfilesImpl(WebDataRequest* request);
+ void AddAutofillProfileImpl(GenericRequest<AutofillProfile>* request);
+ void UpdateAutofillProfileImpl(GenericRequest<AutofillProfile>* request);
+ void RemoveAutofillProfileImpl(GenericRequest<std::string>* request);
+ void GetAutofillProfilesImpl(WebDataRequest* request);
void AddCreditCardImpl(GenericRequest<CreditCard>* request);
void UpdateCreditCardImpl(GenericRequest<CreditCard>* request);
void RemoveCreditCardImpl(GenericRequest<std::string>* request);
void GetCreditCardsImpl(WebDataRequest* request);
- void RemoveAutoFillProfilesAndCreditCardsModifiedBetweenImpl(
+ void RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl(
GenericRequest2<base::Time, base::Time>* request);
// True once initialization has started.
diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc
index e2f538f..90dc950 100644
--- a/chrome/browser/webdata/web_data_service_unittest.cc
+++ b/chrome/browser/webdata/web_data_service_unittest.cc
@@ -252,7 +252,7 @@ TEST_F(WebDataServiceAutofillTest, FormFillRemoveMany) {
}
TEST_F(WebDataServiceAutofillTest, ProfileAdd) {
- AutoFillProfile profile;
+ AutofillProfile profile;
// Check that GUID-based notification was sent.
const AutofillProfileChange expected_change(
@@ -265,12 +265,12 @@ TEST_F(WebDataServiceAutofillTest, ProfileAdd) {
Pointee(expected_change)))).
WillOnce(SignalEvent(&done_event_));
- wds_->AddAutoFillProfile(profile);
+ wds_->AddAutofillProfile(profile);
done_event_.TimedWait(test_timeout_);
// Check that it was added.
- AutofillWebDataServiceConsumer<std::vector<AutoFillProfile*> > consumer;
- WebDataService::Handle handle = wds_->GetAutoFillProfiles(&consumer);
+ AutofillWebDataServiceConsumer<std::vector<AutofillProfile*> > consumer;
+ WebDataService::Handle handle = wds_->GetAutofillProfiles(&consumer);
MessageLoop::current()->Run();
EXPECT_EQ(handle, consumer.handle());
ASSERT_EQ(1U, consumer.result().size());
@@ -279,18 +279,18 @@ TEST_F(WebDataServiceAutofillTest, ProfileAdd) {
}
TEST_F(WebDataServiceAutofillTest, ProfileRemove) {
- AutoFillProfile profile;
+ AutofillProfile profile;
// Add a profile.
EXPECT_CALL(*observer_helper_->observer(), Observe(_, _, _)).
Times(1).
WillOnce(SignalEvent(&done_event_));
- wds_->AddAutoFillProfile(profile);
+ wds_->AddAutofillProfile(profile);
done_event_.TimedWait(test_timeout_);
// Check that it was added.
- AutofillWebDataServiceConsumer<std::vector<AutoFillProfile*> > consumer;
- WebDataService::Handle handle = wds_->GetAutoFillProfiles(&consumer);
+ AutofillWebDataServiceConsumer<std::vector<AutofillProfile*> > consumer;
+ WebDataService::Handle handle = wds_->GetAutofillProfiles(&consumer);
MessageLoop::current()->Run();
EXPECT_EQ(handle, consumer.handle());
ASSERT_EQ(1U, consumer.result().size());
@@ -309,33 +309,33 @@ TEST_F(WebDataServiceAutofillTest, ProfileRemove) {
WillOnce(SignalEvent(&done_event_));
// Remove the profile.
- wds_->RemoveAutoFillProfile(profile.guid());
+ wds_->RemoveAutofillProfile(profile.guid());
done_event_.TimedWait(test_timeout_);
// Check that it was removed.
- AutofillWebDataServiceConsumer<std::vector<AutoFillProfile*> > consumer2;
- WebDataService::Handle handle2 = wds_->GetAutoFillProfiles(&consumer2);
+ AutofillWebDataServiceConsumer<std::vector<AutofillProfile*> > consumer2;
+ WebDataService::Handle handle2 = wds_->GetAutofillProfiles(&consumer2);
MessageLoop::current()->Run();
EXPECT_EQ(handle2, consumer2.handle());
ASSERT_EQ(0U, consumer2.result().size());
}
TEST_F(WebDataServiceAutofillTest, ProfileUpdate) {
- AutoFillProfile profile1;
+ AutofillProfile profile1;
profile1.SetInfo(AutofillType(NAME_FIRST), ASCIIToUTF16("Abe"));
- AutoFillProfile profile2;
+ AutofillProfile profile2;
profile2.SetInfo(AutofillType(NAME_FIRST), ASCIIToUTF16("Alice"));
EXPECT_CALL(*observer_helper_->observer(), Observe(_, _, _)).
WillOnce(DoDefault()).
WillOnce(SignalEvent(&done_event_));
- wds_->AddAutoFillProfile(profile1);
- wds_->AddAutoFillProfile(profile2);
+ wds_->AddAutofillProfile(profile1);
+ wds_->AddAutofillProfile(profile2);
done_event_.TimedWait(test_timeout_);
// Check that they were added.
- AutofillWebDataServiceConsumer<std::vector<AutoFillProfile*> > consumer;
- WebDataService::Handle handle = wds_->GetAutoFillProfiles(&consumer);
+ AutofillWebDataServiceConsumer<std::vector<AutofillProfile*> > consumer;
+ WebDataService::Handle handle = wds_->GetAutofillProfiles(&consumer);
MessageLoop::current()->Run();
EXPECT_EQ(handle, consumer.handle());
ASSERT_EQ(2U, consumer.result().size());
@@ -343,7 +343,7 @@ TEST_F(WebDataServiceAutofillTest, ProfileUpdate) {
EXPECT_EQ(profile2, *consumer.result()[1]);
STLDeleteElements(&consumer.result());
- AutoFillProfile profile1_changed(profile1);
+ AutofillProfile profile1_changed(profile1);
profile1_changed.SetInfo(AutofillType(NAME_FIRST), ASCIIToUTF16("Bill"));
const AutofillProfileChange expected_change(
AutofillProfileChange::UPDATE, profile1.guid(), &profile1_changed);
@@ -357,12 +357,12 @@ TEST_F(WebDataServiceAutofillTest, ProfileUpdate) {
WillOnce(SignalEvent(&done_event_));
// Update the profile.
- wds_->UpdateAutoFillProfile(profile1_changed);
+ wds_->UpdateAutofillProfile(profile1_changed);
done_event_.TimedWait(test_timeout_);
// Check that the updates were made.
- AutofillWebDataServiceConsumer<std::vector<AutoFillProfile*> > consumer2;
- WebDataService::Handle handle2 = wds_->GetAutoFillProfiles(&consumer2);
+ AutofillWebDataServiceConsumer<std::vector<AutofillProfile*> > consumer2;
+ WebDataService::Handle handle2 = wds_->GetAutofillProfiles(&consumer2);
MessageLoop::current()->Run();
EXPECT_EQ(handle2, consumer2.handle());
ASSERT_EQ(2U, consumer2.result().size());
diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc
index 735ac10..9d11629 100644
--- a/chrome/browser/webdata/web_database.cc
+++ b/chrome/browser/webdata/web_database.cc
@@ -280,7 +280,7 @@ string16 LimitDataSize(const string16& data) {
return data;
}
-void BindAutoFillProfileToStatement(const AutoFillProfile& profile,
+void BindAutofillProfileToStatement(const AutofillProfile& profile,
sql::Statement* s) {
DCHECK(guid::IsValidGUID(profile.guid()));
s->BindString(0, profile.guid());
@@ -304,8 +304,8 @@ void BindAutoFillProfileToStatement(const AutoFillProfile& profile,
s->BindInt64(9, Time::Now().ToTimeT());
}
-AutoFillProfile* AutoFillProfileFromStatement(const sql::Statement& s) {
- AutoFillProfile* profile = new AutoFillProfile;
+AutofillProfile* AutofillProfileFromStatement(const sql::Statement& s) {
+ AutofillProfile* profile = new AutofillProfile;
profile->set_guid(s.ColumnString(0));
DCHECK(guid::IsValidGUID(profile->guid()));
@@ -322,8 +322,8 @@ AutoFillProfile* AutoFillProfileFromStatement(const sql::Statement& s) {
return profile;
}
-void AddAutoFillProfileNameFromStatement(const sql::Statement& s,
- AutoFillProfile* profile) {
+void AddAutofillProfileNameFromStatement(const sql::Statement& s,
+ AutofillProfile* profile) {
DCHECK_EQ(profile->guid(), s.ColumnString(0));
DCHECK(guid::IsValidGUID(profile->guid()));
@@ -332,24 +332,24 @@ void AddAutoFillProfileNameFromStatement(const sql::Statement& s,
profile->SetInfo(AutofillType(NAME_LAST), s.ColumnString16(3));
}
-void AddAutoFillProfileEmailFromStatement(const sql::Statement& s,
- AutoFillProfile* profile) {
+void AddAutofillProfileEmailFromStatement(const sql::Statement& s,
+ AutofillProfile* profile) {
DCHECK_EQ(profile->guid(), s.ColumnString(0));
DCHECK(guid::IsValidGUID(profile->guid()));
profile->SetInfo(AutofillType(EMAIL_ADDRESS), s.ColumnString16(1));
}
-void AddAutoFillProfilePhoneFromStatement(const sql::Statement& s,
- AutoFillProfile* profile) {
+void AddAutofillProfilePhoneFromStatement(const sql::Statement& s,
+ AutofillProfile* profile) {
DCHECK_EQ(profile->guid(), s.ColumnString(0));
DCHECK(guid::IsValidGUID(profile->guid()));
DCHECK_EQ(kAutoFillPhoneNumber, s.ColumnInt(1));
profile->SetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER), s.ColumnString16(2));
}
-void AddAutoFillProfileFaxFromStatement(const sql::Statement& s,
- AutoFillProfile* profile) {
+void AddAutofillProfileFaxFromStatement(const sql::Statement& s,
+ AutofillProfile* profile) {
DCHECK_EQ(profile->guid(), s.ColumnString(0));
DCHECK(guid::IsValidGUID(profile->guid()));
DCHECK_EQ(kAutoFillFaxNumber, s.ColumnInt(1));
@@ -400,16 +400,16 @@ CreditCard* CreditCardFromStatement(const sql::Statement& s) {
return credit_card;
}
-bool AutoFillProfileHasName(const AutoFillProfile& profile) {
+bool AutofillProfileHasName(const AutofillProfile& profile) {
return !profile.GetFieldText(AutofillType(NAME_FIRST)).empty() ||
!profile.GetFieldText(AutofillType(NAME_MIDDLE)).empty() ||
!profile.GetFieldText(AutofillType(NAME_MIDDLE)).empty();
}
-bool AddAutoFillProfileName(const std::string& guid,
- const AutoFillProfile& profile,
+bool AddAutofillProfileName(const std::string& guid,
+ const AutofillProfile& profile,
sql::Connection* db) {
- if (!AutoFillProfileHasName(profile))
+ if (!AutofillProfileHasName(profile))
return true;
// Check for duplicate.
@@ -449,8 +449,8 @@ bool AddAutoFillProfileName(const std::string& guid,
return true;
}
-bool AddAutoFillProfileEmail(const std::string& guid,
- const AutoFillProfile& profile,
+bool AddAutofillProfileEmail(const std::string& guid,
+ const AutofillProfile& profile,
sql::Connection* db) {
if (profile.GetFieldText(AutofillType(EMAIL_ADDRESS)).empty())
return true;
@@ -487,8 +487,8 @@ bool AddAutoFillProfileEmail(const std::string& guid,
return true;
}
-bool AddAutoFillProfilePhone(const std::string& guid,
- const AutoFillProfile& profile,
+bool AddAutofillProfilePhone(const std::string& guid,
+ const AutofillProfile& profile,
AutoFillPhoneType phone_type,
sql::Connection* db) {
AutofillFieldType field_type;
@@ -540,25 +540,25 @@ bool AddAutoFillProfilePhone(const std::string& guid,
return true;
}
-bool AddAutoFillProfilePieces(const std::string& guid,
- const AutoFillProfile& profile,
+bool AddAutofillProfilePieces(const std::string& guid,
+ const AutofillProfile& profile,
sql::Connection* db) {
- if (!AddAutoFillProfileName(guid, profile, db))
+ if (!AddAutofillProfileName(guid, profile, db))
return false;
- if (!AddAutoFillProfileEmail(guid, profile, db))
+ if (!AddAutofillProfileEmail(guid, profile, db))
return false;
- if (!AddAutoFillProfilePhone(guid, profile, kAutoFillPhoneNumber, db))
+ if (!AddAutofillProfilePhone(guid, profile, kAutoFillPhoneNumber, db))
return false;
- if (!AddAutoFillProfilePhone(guid, profile, kAutoFillFaxNumber, db))
+ if (!AddAutofillProfilePhone(guid, profile, kAutoFillFaxNumber, db))
return false;
return true;
}
-bool RemoveAutoFillProfilePieces(const std::string& guid, sql::Connection* db) {
+bool RemoveAutofillProfilePieces(const std::string& guid, sql::Connection* db) {
sql::Statement s1(db->GetUniqueStatement(
"DELETE FROM autofill_profile_names WHERE guid = ?"));
if (!s1) {
@@ -649,9 +649,9 @@ sql::InitStatus WebDatabase::Init(const FilePath& db_name) {
// Initialize the tables.
if (!InitKeywordsTable() || !InitLoginsTable() || !InitWebAppIconsTable() ||
!InitWebAppsTable() || !InitAutofillTable() ||
- !InitAutofillDatesTable() || !InitAutoFillProfilesTable() ||
- !InitAutoFillProfileNamesTable() || !InitAutoFillProfileEmailsTable() ||
- !InitAutoFillProfilePhonesTable() || !InitCreditCardsTable() ||
+ !InitAutofillDatesTable() || !InitAutofillProfilesTable() ||
+ !InitAutofillProfileNamesTable() || !InitAutofillProfileEmailsTable() ||
+ !InitAutofillProfilePhonesTable() || !InitCreditCardsTable() ||
!InitTokenServiceTable()) {
LOG(WARNING) << "Unable to initialize the web database.";
return sql::INIT_FAILURE;
@@ -938,7 +938,7 @@ bool WebDatabase::InitAutofillDatesTable() {
return true;
}
-bool WebDatabase::InitAutoFillProfilesTable() {
+bool WebDatabase::InitAutofillProfilesTable() {
if (!db_.DoesTableExist("autofill_profiles")) {
if (!db_.Execute("CREATE TABLE autofill_profiles ( "
"guid VARCHAR PRIMARY KEY, "
@@ -958,7 +958,7 @@ bool WebDatabase::InitAutoFillProfilesTable() {
return true;
}
-bool WebDatabase::InitAutoFillProfileNamesTable() {
+bool WebDatabase::InitAutofillProfileNamesTable() {
if (!db_.DoesTableExist("autofill_profile_names")) {
if (!db_.Execute("CREATE TABLE autofill_profile_names ( "
"guid VARCHAR, "
@@ -972,7 +972,7 @@ bool WebDatabase::InitAutoFillProfileNamesTable() {
return true;
}
-bool WebDatabase::InitAutoFillProfileEmailsTable() {
+bool WebDatabase::InitAutofillProfileEmailsTable() {
if (!db_.DoesTableExist("autofill_profile_emails")) {
if (!db_.Execute("CREATE TABLE autofill_profile_emails ( "
"guid VARCHAR, "
@@ -984,7 +984,7 @@ bool WebDatabase::InitAutoFillProfileEmailsTable() {
return true;
}
-bool WebDatabase::InitAutoFillProfilePhonesTable() {
+bool WebDatabase::InitAutofillProfilePhonesTable() {
if (!db_.DoesTableExist("autofill_profile_phones")) {
if (!db_.Execute("CREATE TABLE autofill_profile_phones ( "
"guid VARCHAR, "
@@ -1846,7 +1846,7 @@ bool WebDatabase::RemoveFormElement(const string16& name,
return false;
}
-bool WebDatabase::AddAutoFillProfile(const AutoFillProfile& profile) {
+bool WebDatabase::AddAutofillProfile(const AutofillProfile& profile) {
sql::Statement s(db_.GetUniqueStatement(
"INSERT INTO autofill_profiles"
"(guid, company_name, address_line_1, address_line_2, city, state,"
@@ -1857,7 +1857,7 @@ bool WebDatabase::AddAutoFillProfile(const AutoFillProfile& profile) {
return false;
}
- BindAutoFillProfileToStatement(profile, &s);
+ BindAutofillProfileToStatement(profile, &s);
if (!s.Run()) {
NOTREACHED();
@@ -1867,11 +1867,11 @@ bool WebDatabase::AddAutoFillProfile(const AutoFillProfile& profile) {
if (!s.Succeeded())
return false;
- return AddAutoFillProfilePieces(profile.guid(), profile, &db_);
+ return AddAutofillProfilePieces(profile.guid(), profile, &db_);
}
-bool WebDatabase::GetAutoFillProfile(const std::string& guid,
- AutoFillProfile** profile) {
+bool WebDatabase::GetAutofillProfile(const std::string& guid,
+ AutofillProfile** profile) {
DCHECK(guid::IsValidGUID(guid));
DCHECK(profile);
sql::Statement s(db_.GetUniqueStatement(
@@ -1891,7 +1891,7 @@ bool WebDatabase::GetAutoFillProfile(const std::string& guid,
if (!s.Succeeded())
return false;
- scoped_ptr<AutoFillProfile> p(AutoFillProfileFromStatement(s));
+ scoped_ptr<AutofillProfile> p(AutofillProfileFromStatement(s));
// Get associated name info.
sql::Statement s2(db_.GetUniqueStatement(
@@ -1905,7 +1905,7 @@ bool WebDatabase::GetAutoFillProfile(const std::string& guid,
s2.BindString(0, guid);
if (s2.Step()) {
- AddAutoFillProfileNameFromStatement(s2, p.get());
+ AddAutofillProfileNameFromStatement(s2, p.get());
}
// Get associated email info.
@@ -1920,7 +1920,7 @@ bool WebDatabase::GetAutoFillProfile(const std::string& guid,
s3.BindString(0, guid);
if (s3.Step()) {
- AddAutoFillProfileEmailFromStatement(s3, p.get());
+ AddAutofillProfileEmailFromStatement(s3, p.get());
}
// Get associated phone info.
@@ -1936,7 +1936,7 @@ bool WebDatabase::GetAutoFillProfile(const std::string& guid,
s4.BindInt(1, kAutoFillPhoneNumber);
if (s4.Step()) {
- AddAutoFillProfilePhoneFromStatement(s4, p.get());
+ AddAutofillProfilePhoneFromStatement(s4, p.get());
}
// Get associated fax info.
@@ -1952,15 +1952,15 @@ bool WebDatabase::GetAutoFillProfile(const std::string& guid,
s5.BindInt(1, kAutoFillFaxNumber);
if (s5.Step()) {
- AddAutoFillProfileFaxFromStatement(s5, p.get());
+ AddAutofillProfileFaxFromStatement(s5, p.get());
}
*profile = p.release();
return true;
}
-bool WebDatabase::GetAutoFillProfiles(
- std::vector<AutoFillProfile*>* profiles) {
+bool WebDatabase::GetAutofillProfiles(
+ std::vector<AutofillProfile*>* profiles) {
DCHECK(profiles);
profiles->clear();
@@ -1974,8 +1974,8 @@ bool WebDatabase::GetAutoFillProfiles(
while (s.Step()) {
std::string guid = s.ColumnString(0);
- AutoFillProfile* profile = NULL;
- if (!GetAutoFillProfile(guid, &profile))
+ AutofillProfile* profile = NULL;
+ if (!GetAutofillProfile(guid, &profile))
return false;
profiles->push_back(profile);
}
@@ -1983,15 +1983,15 @@ bool WebDatabase::GetAutoFillProfiles(
return s.Succeeded();
}
-bool WebDatabase::UpdateAutoFillProfile(const AutoFillProfile& profile) {
+bool WebDatabase::UpdateAutofillProfile(const AutofillProfile& profile) {
DCHECK(guid::IsValidGUID(profile.guid()));
- AutoFillProfile* tmp_profile = NULL;
- if (!GetAutoFillProfile(profile.guid(), &tmp_profile))
+ AutofillProfile* tmp_profile = NULL;
+ if (!GetAutofillProfile(profile.guid(), &tmp_profile))
return false;
// Preserve appropriate modification dates by not updating unchanged profiles.
- scoped_ptr<AutoFillProfile> old_profile(tmp_profile);
+ scoped_ptr<AutofillProfile> old_profile(tmp_profile);
if (*old_profile == profile)
return true;
@@ -2006,7 +2006,7 @@ bool WebDatabase::UpdateAutoFillProfile(const AutoFillProfile& profile) {
return false;
}
- BindAutoFillProfileToStatement(profile, &s);
+ BindAutofillProfileToStatement(profile, &s);
s.BindString(10, profile.guid());
bool result = s.Run();
DCHECK_GT(db_.GetLastChangeCount(), 0);
@@ -2014,13 +2014,13 @@ bool WebDatabase::UpdateAutoFillProfile(const AutoFillProfile& profile) {
return result;
// Remove the old names, emails, and phone/fax numbers.
- if (!RemoveAutoFillProfilePieces(profile.guid(), &db_))
+ if (!RemoveAutofillProfilePieces(profile.guid(), &db_))
return false;
- return AddAutoFillProfilePieces(profile.guid(), profile, &db_);
+ return AddAutofillProfilePieces(profile.guid(), profile, &db_);
}
-bool WebDatabase::RemoveAutoFillProfile(const std::string& guid) {
+bool WebDatabase::RemoveAutofillProfile(const std::string& guid) {
DCHECK(guid::IsValidGUID(guid));
sql::Statement s(db_.GetUniqueStatement(
"DELETE FROM autofill_profiles WHERE guid = ?"));
@@ -2033,7 +2033,7 @@ bool WebDatabase::RemoveAutoFillProfile(const std::string& guid) {
if (!s.Run())
return false;
- return RemoveAutoFillProfilePieces(guid, &db_);
+ return RemoveAutofillProfilePieces(guid, &db_);
}
bool WebDatabase::AddCreditCard(const CreditCard& credit_card) {
@@ -2146,7 +2146,7 @@ bool WebDatabase::RemoveCreditCard(const std::string& guid) {
return s.Run();
}
-bool WebDatabase::RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
+bool WebDatabase::RemoveAutofillProfilesAndCreditCardsModifiedBetween(
base::Time delete_begin,
base::Time delete_end) {
DCHECK(delete_end.is_null() || delete_begin < delete_end);
@@ -2678,7 +2678,7 @@ sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded(){
// Add |guid| column to |autofill_profiles| table.
// Note that we need to check for the guid column's existence due to the
// fact that for a version 22 database the |autofill_profiles| table
- // gets created fresh with |InitAutoFillProfilesTable|.
+ // gets created fresh with |InitAutofillProfilesTable|.
if (!db_.DoesColumnExist("autofill_profiles", "guid")) {
if (!db_.Execute("ALTER TABLE autofill_profiles ADD COLUMN "
"guid VARCHAR NOT NULL DEFAULT \"\"")) {
@@ -2722,7 +2722,7 @@ sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded(){
// Add |guid| column to |credit_cards| table.
// Note that we need to check for the guid column's existence due to the
// fact that for a version 22 database the |autofill_profiles| table
- // gets created fresh with |InitAutoFillProfilesTable|.
+ // gets created fresh with |InitAutofillProfilesTable|.
if (!db_.DoesColumnExist("credit_cards", "guid")) {
if (!db_.Execute("ALTER TABLE credit_cards ADD COLUMN "
"guid VARCHAR NOT NULL DEFAULT \"\"")) {
@@ -2891,7 +2891,7 @@ sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded(){
"zipcode, country, phone, fax, date_modified "
"FROM autofill_profiles"));
while (s.Step()) {
- AutoFillProfile profile;
+ AutofillProfile profile;
profile.set_guid(s.ColumnString(0));
DCHECK(guid::IsValidGUID(profile.guid()));
@@ -2951,7 +2951,7 @@ sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded(){
}
// Add the other bits: names, emails, and phone/fax.
- if (!AddAutoFillProfilePieces(profile.guid(), profile, &db_)) {
+ if (!AddAutofillProfilePieces(profile.guid(), profile, &db_)) {
NOTREACHED();
return sql::INIT_FAILURE;
}
diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h
index 6aeca08..2b647a8 100644
--- a/chrome/browser/webdata/web_database.h
+++ b/chrome/browser/webdata/web_database.h
@@ -18,7 +18,7 @@
class AutofillChange;
class AutofillEntry;
-class AutoFillProfile;
+class AutofillProfile;
class CreditCard;
class FilePath;
class GURL;
@@ -222,20 +222,20 @@ class WebDatabase {
virtual bool UpdateAutofillEntries(const std::vector<AutofillEntry>& entries);
// Records a single AutoFill profile in the autofill_profiles table.
- virtual bool AddAutoFillProfile(const AutoFillProfile& profile);
+ virtual bool AddAutofillProfile(const AutofillProfile& profile);
// Updates the database values for the specified profile.
- virtual bool UpdateAutoFillProfile(const AutoFillProfile& profile);
+ virtual bool UpdateAutofillProfile(const AutofillProfile& profile);
// Removes a row from the autofill_profiles table. |guid| is the identifier
// of the profile to remove.
- virtual bool RemoveAutoFillProfile(const std::string& guid);
+ virtual bool RemoveAutofillProfile(const std::string& guid);
// Retrieves a profile with guid |guid|. The caller owns |profile|.
- bool GetAutoFillProfile(const std::string& guid, AutoFillProfile** profile);
+ bool GetAutofillProfile(const std::string& guid, AutofillProfile** profile);
// Retrieves all profiles in the database. Caller owns the returned profiles.
- virtual bool GetAutoFillProfiles(std::vector<AutoFillProfile*>* profiles);
+ virtual bool GetAutofillProfiles(std::vector<AutofillProfile*>* profiles);
// Records a single credit card in the credit_cards table.
bool AddCreditCard(const CreditCard& credit_card);
@@ -257,7 +257,7 @@ class WebDatabase {
// Removes rows from autofill_profiles and credit_cards if they were created
// on or after |delete_begin| and strictly before |delete_end|.
- bool RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
+ bool RemoveAutofillProfilesAndCreditCardsModifiedBetween(
base::Time delete_begin,
base::Time delete_end);
@@ -307,12 +307,12 @@ class WebDatabase {
Autofill_GetAllAutofillEntries_TwoSame);
FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, Autofill_UpdateDontReplace);
FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, Autofill_AddFormFieldValues);
- FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, AutoFillProfile);
+ FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, AutofillProfile);
FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, CreditCard);
- FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, UpdateAutoFillProfile);
+ FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, UpdateAutofillProfile);
FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest, UpdateCreditCard);
FRIEND_TEST_ALL_PREFIXES(WebDatabaseTest,
- RemoveAutoFillProfilesAndCreditCardsModifiedBetween);
+ RemoveAutofillProfilesAndCreditCardsModifiedBetween);
// Methods for adding autofill entries at a specified time. For
// testing only.
@@ -337,10 +337,10 @@ class WebDatabase {
bool InitLoginsTable();
bool InitAutofillTable();
bool InitAutofillDatesTable();
- bool InitAutoFillProfilesTable();
- bool InitAutoFillProfileNamesTable();
- bool InitAutoFillProfileEmailsTable();
- bool InitAutoFillProfilePhonesTable();
+ bool InitAutofillProfilesTable();
+ bool InitAutofillProfileNamesTable();
+ bool InitAutofillProfileEmailsTable();
+ bool InitAutofillProfilePhonesTable();
bool InitCreditCardsTable();
bool InitTokenServiceTable();
bool InitWebAppIconsTable();
diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc
index 559f70b..c37f75c 100644
--- a/chrome/browser/webdata/web_database_unittest.cc
+++ b/chrome/browser/webdata/web_database_unittest.cc
@@ -94,8 +94,8 @@ bool CompareAutofillEntries(const AutofillEntry& a, const AutofillEntry& b) {
return !timestamps2.empty();
}
-void AutoFillProfile31FromStatement(const sql::Statement& s,
- AutoFillProfile* profile,
+void AutofillProfile31FromStatement(const sql::Statement& s,
+ AutofillProfile* profile,
string16* label,
int* unique_id,
int64* date_modified) {
@@ -123,8 +123,8 @@ void AutoFillProfile31FromStatement(const sql::Statement& s,
EXPECT_TRUE(guid::IsValidGUID(profile->guid()));
}
-void AutoFillProfile32FromStatement(const sql::Statement& s,
- AutoFillProfile* profile,
+void AutofillProfile32FromStatement(const sql::Statement& s,
+ AutofillProfile* profile,
string16* label,
int64* date_modified) {
DCHECK(profile);
@@ -149,8 +149,8 @@ void AutoFillProfile32FromStatement(const sql::Statement& s,
*date_modified = s.ColumnInt64(15);
}
-void AutoFillProfile33FromStatement(const sql::Statement& s,
- AutoFillProfile* profile,
+void AutofillProfile33FromStatement(const sql::Statement& s,
+ AutofillProfile* profile,
int64* date_modified) {
DCHECK(profile);
DCHECK(date_modified);
@@ -1401,13 +1401,13 @@ TEST_F(WebDatabaseTest, TokenServiceGetSet) {
EXPECT_EQ(out_map.find(service)->second, "ham");
}
-TEST_F(WebDatabaseTest, AutoFillProfile) {
+TEST_F(WebDatabaseTest, AutofillProfile) {
WebDatabase db;
ASSERT_EQ(sql::INIT_OK, db.Init(file_));
// Add a 'Home' profile.
- AutoFillProfile home_profile;
+ AutofillProfile home_profile;
home_profile.SetInfo(AutofillType(NAME_FIRST), ASCIIToUTF16("John"));
home_profile.SetInfo(AutofillType(NAME_MIDDLE), ASCIIToUTF16("Q."));
home_profile.SetInfo(AutofillType(NAME_LAST), ASCIIToUTF16("Smith"));
@@ -1429,12 +1429,12 @@ TEST_F(WebDatabaseTest, AutoFillProfile) {
ASCIIToUTF16("1915243678"));
Time pre_creation_time = Time::Now();
- EXPECT_TRUE(db.AddAutoFillProfile(home_profile));
+ EXPECT_TRUE(db.AddAutofillProfile(home_profile));
Time post_creation_time = Time::Now();
// Get the 'Home' profile.
- AutoFillProfile* db_profile;
- ASSERT_TRUE(db.GetAutoFillProfile(home_profile.guid(), &db_profile));
+ AutofillProfile* db_profile;
+ ASSERT_TRUE(db.GetAutofillProfile(home_profile.guid(), &db_profile));
EXPECT_EQ(home_profile, *db_profile);
sql::Statement s_home(db.db_.GetUniqueStatement(
"SELECT date_modified "
@@ -1448,7 +1448,7 @@ TEST_F(WebDatabaseTest, AutoFillProfile) {
delete db_profile;
// Add a 'Billing' profile.
- AutoFillProfile billing_profile = home_profile;
+ AutofillProfile billing_profile = home_profile;
billing_profile.set_guid(guid::GenerateGUID());
billing_profile.SetInfo(AutofillType(ADDRESS_HOME_LINE1),
ASCIIToUTF16("5678 Bottom Street"));
@@ -1456,11 +1456,11 @@ TEST_F(WebDatabaseTest, AutoFillProfile) {
ASCIIToUTF16("suite 3"));
pre_creation_time = Time::Now();
- EXPECT_TRUE(db.AddAutoFillProfile(billing_profile));
+ EXPECT_TRUE(db.AddAutofillProfile(billing_profile));
post_creation_time = Time::Now();
// Get the 'Billing' profile.
- ASSERT_TRUE(db.GetAutoFillProfile(billing_profile.guid(), &db_profile));
+ ASSERT_TRUE(db.GetAutofillProfile(billing_profile.guid(), &db_profile));
EXPECT_EQ(billing_profile, *db_profile);
sql::Statement s_billing(db.db_.GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles WHERE guid=?"));
@@ -1475,9 +1475,9 @@ TEST_F(WebDatabaseTest, AutoFillProfile) {
// Update the 'Billing' profile, name only.
billing_profile.SetInfo(AutofillType(NAME_FIRST), ASCIIToUTF16("Jane"));
Time pre_modification_time = Time::Now();
- EXPECT_TRUE(db.UpdateAutoFillProfile(billing_profile));
+ EXPECT_TRUE(db.UpdateAutofillProfile(billing_profile));
Time post_modification_time = Time::Now();
- ASSERT_TRUE(db.GetAutoFillProfile(billing_profile.guid(), &db_profile));
+ ASSERT_TRUE(db.GetAutofillProfile(billing_profile.guid(), &db_profile));
EXPECT_EQ(billing_profile, *db_profile);
sql::Statement s_billing_updated(db.db_.GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles WHERE guid=?"));
@@ -1514,9 +1514,9 @@ TEST_F(WebDatabaseTest, AutoFillProfile) {
billing_profile.SetInfo(AutofillType(PHONE_FAX_WHOLE_NUMBER),
ASCIIToUTF16("1915240000"));
Time pre_modification_time_2 = Time::Now();
- EXPECT_TRUE(db.UpdateAutoFillProfile(billing_profile));
+ EXPECT_TRUE(db.UpdateAutofillProfile(billing_profile));
Time post_modification_time_2 = Time::Now();
- ASSERT_TRUE(db.GetAutoFillProfile(billing_profile.guid(), &db_profile));
+ ASSERT_TRUE(db.GetAutofillProfile(billing_profile.guid(), &db_profile));
EXPECT_EQ(billing_profile, *db_profile);
sql::Statement s_billing_updated_2(db.db_.GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles WHERE guid=?"));
@@ -1531,8 +1531,8 @@ TEST_F(WebDatabaseTest, AutoFillProfile) {
delete db_profile;
// Remove the 'Billing' profile.
- EXPECT_TRUE(db.RemoveAutoFillProfile(billing_profile.guid()));
- EXPECT_FALSE(db.GetAutoFillProfile(billing_profile.guid(), &db_profile));
+ EXPECT_TRUE(db.RemoveAutofillProfile(billing_profile.guid()));
+ EXPECT_FALSE(db.GetAutofillProfile(billing_profile.guid(), &db_profile));
}
TEST_F(WebDatabaseTest, CreditCard) {
@@ -1624,12 +1624,12 @@ TEST_F(WebDatabaseTest, CreditCard) {
EXPECT_FALSE(db.GetCreditCard(target_creditcard.guid(), &db_creditcard));
}
-TEST_F(WebDatabaseTest, UpdateAutoFillProfile) {
+TEST_F(WebDatabaseTest, UpdateAutofillProfile) {
WebDatabase db;
ASSERT_EQ(sql::INIT_OK, db.Init(file_));
// Add a profile to the db.
- AutoFillProfile profile;
+ AutofillProfile profile;
profile.SetInfo(AutofillType(NAME_FIRST), ASCIIToUTF16("John"));
profile.SetInfo(AutofillType(NAME_MIDDLE), ASCIIToUTF16("Q."));
profile.SetInfo(AutofillType(NAME_LAST), ASCIIToUTF16("Smith"));
@@ -1646,7 +1646,7 @@ TEST_F(WebDatabaseTest, UpdateAutoFillProfile) {
ASCIIToUTF16("18181234567"));
profile.SetInfo(AutofillType(PHONE_FAX_WHOLE_NUMBER),
ASCIIToUTF16("1915243678"));
- db.AddAutoFillProfile(profile);
+ db.AddAutofillProfile(profile);
// Set a mocked value for the profile's creation time.
const time_t mock_creation_date = Time::Now().ToTimeT() - 13;
@@ -1657,9 +1657,9 @@ TEST_F(WebDatabaseTest, UpdateAutoFillProfile) {
ASSERT_TRUE(s_mock_creation_date.Run());
// Get the profile.
- AutoFillProfile* tmp_profile;
- ASSERT_TRUE(db.GetAutoFillProfile(profile.guid(), &tmp_profile));
- scoped_ptr<AutoFillProfile> db_profile(tmp_profile);
+ AutofillProfile* tmp_profile;
+ ASSERT_TRUE(db.GetAutofillProfile(profile.guid(), &tmp_profile));
+ scoped_ptr<AutofillProfile> db_profile(tmp_profile);
EXPECT_EQ(profile, *db_profile);
sql::Statement s_original(db.db_.GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
@@ -1671,10 +1671,10 @@ TEST_F(WebDatabaseTest, UpdateAutoFillProfile) {
// Now, update the profile and save the update to the database.
// The modification date should change to reflect the update.
profile.SetInfo(AutofillType(EMAIL_ADDRESS), ASCIIToUTF16("js@smith.xyz"));
- db.UpdateAutoFillProfile(profile);
+ db.UpdateAutofillProfile(profile);
// Get the profile.
- ASSERT_TRUE(db.GetAutoFillProfile(profile.guid(), &tmp_profile));
+ ASSERT_TRUE(db.GetAutofillProfile(profile.guid(), &tmp_profile));
db_profile.reset(tmp_profile);
EXPECT_EQ(profile, *db_profile);
sql::Statement s_updated(db.db_.GetUniqueStatement(
@@ -1692,12 +1692,12 @@ TEST_F(WebDatabaseTest, UpdateAutoFillProfile) {
s_mock_modification_date.BindInt64(0, mock_modification_date);
ASSERT_TRUE(s_mock_modification_date.Run());
- // Finally, call into |UpdateAutoFillProfile()| without changing the profile.
+ // Finally, call into |UpdateAutofillProfile()| without changing the profile.
// The modification date should not change.
- db.UpdateAutoFillProfile(profile);
+ db.UpdateAutofillProfile(profile);
// Get the profile.
- ASSERT_TRUE(db.GetAutoFillProfile(profile.guid(), &tmp_profile));
+ ASSERT_TRUE(db.GetAutofillProfile(profile.guid(), &tmp_profile));
db_profile.reset(tmp_profile);
EXPECT_EQ(profile, *db_profile);
sql::Statement s_unchanged(db.db_.GetUniqueStatement(
@@ -1784,7 +1784,7 @@ TEST_F(WebDatabaseTest, UpdateCreditCard) {
EXPECT_FALSE(s_unchanged.Step());
}
-TEST_F(WebDatabaseTest, RemoveAutoFillProfilesAndCreditCardsModifiedBetween) {
+TEST_F(WebDatabaseTest, RemoveAutofillProfilesAndCreditCardsModifiedBetween) {
WebDatabase db;
ASSERT_EQ(sql::INIT_OK, db.Init(file_));
@@ -1816,7 +1816,7 @@ TEST_F(WebDatabaseTest, RemoveAutoFillProfilesAndCreditCardsModifiedBetween) {
"VALUES('00000000-0000-0000-0000-000000000011', 67);"));
// Remove all entries modified in the bounded time range [17,41).
- db.RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
+ db.RemoveAutofillProfilesAndCreditCardsModifiedBetween(
base::Time::FromTimeT(17), base::Time::FromTimeT(41));
sql::Statement s_autofill_profiles_bounded(db.db_.GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
@@ -1842,7 +1842,7 @@ TEST_F(WebDatabaseTest, RemoveAutoFillProfilesAndCreditCardsModifiedBetween) {
EXPECT_FALSE(s_credit_cards_bounded.Step());
// Remove all entries modified on or after time 51 (unbounded range).
- db.RemoveAutoFillProfilesAndCreditCardsModifiedBetween(
+ db.RemoveAutofillProfilesAndCreditCardsModifiedBetween(
base::Time::FromTimeT(51), base::Time());
sql::Statement s_autofill_profiles_unbounded(db.db_.GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
@@ -1860,7 +1860,7 @@ TEST_F(WebDatabaseTest, RemoveAutoFillProfilesAndCreditCardsModifiedBetween) {
EXPECT_FALSE(s_credit_cards_unbounded.Step());
// Remove all remaining entries.
- db.RemoveAutoFillProfilesAndCreditCardsModifiedBetween(base::Time(),
+ db.RemoveAutofillProfilesAndCreditCardsModifiedBetween(base::Time(),
base::Time());
sql::Statement s_autofill_profiles_empty(db.db_.GetUniqueStatement(
"SELECT date_modified FROM autofill_profiles"));
@@ -2686,7 +2686,7 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion31ToCurrent) {
// Verify pre-conditions. These are expectations for version 30 of the
// database.
- AutoFillProfile profile;
+ AutofillProfile profile;
string16 profile_label;
int profile_unique_id = 0;
int64 profile_date_modified = 0;
@@ -2721,7 +2721,7 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion31ToCurrent) {
"zipcode, country, phone, fax, date_modified, guid "
"FROM autofill_profiles"));
ASSERT_TRUE(s1.Step());
- EXPECT_NO_FATAL_FAILURE(AutoFillProfile31FromStatement(
+ EXPECT_NO_FATAL_FAILURE(AutofillProfile31FromStatement(
s1, &profile, &profile_label, &profile_unique_id,
&profile_date_modified));
@@ -2783,9 +2783,9 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion31ToCurrent) {
"FROM autofill_profiles"));
ASSERT_TRUE(s1.Step());
- AutoFillProfile profile_a;
+ AutofillProfile profile_a;
int64 profile_date_modified_a = 0;
- EXPECT_NO_FATAL_FAILURE(AutoFillProfile33FromStatement(
+ EXPECT_NO_FATAL_FAILURE(AutofillProfile33FromStatement(
s1, &profile_a, &profile_date_modified_a));
EXPECT_EQ(profile.guid(), profile_a.guid());
EXPECT_EQ(profile.GetFieldText(AutofillType(COMPANY_NAME)),