summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 20:10:45 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 20:10:45 +0000
commitddb1e5ae096bd91da721887fd55e68c603bf7067 (patch)
tree401d9a379ff03bb8b69a1ce9c23fe182f673f587 /chrome/browser/autofill
parent1c9526e0650a91e412d815417634c9f193b1a4d5 (diff)
downloadchromium_src-ddb1e5ae096bd91da721887fd55e68c603bf7067.zip
chromium_src-ddb1e5ae096bd91da721887fd55e68c603bf7067.tar.gz
chromium_src-ddb1e5ae096bd91da721887fd55e68c603bf7067.tar.bz2
Even more virtual method deinlining.
BUG=none TEST=compiles Review URL: http://codereview.chromium.org/5741001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/credit_card.cc4
-rw-r--r--chrome/browser/autofill/credit_card.h2
-rw-r--r--chrome/browser/autofill/fax_number.cc33
-rw-r--r--chrome/browser/autofill/fax_number.h30
-rw-r--r--chrome/browser/autofill/form_field.cc4
-rw-r--r--chrome/browser/autofill/form_field.h2
-rw-r--r--chrome/browser/autofill/home_address.cc41
-rw-r--r--chrome/browser/autofill/home_address.h39
-rw-r--r--chrome/browser/autofill/name_field.cc11
-rw-r--r--chrome/browser/autofill/name_field.h9
-rw-r--r--chrome/browser/autofill/personal_data_manager.cc12
-rw-r--r--chrome/browser/autofill/personal_data_manager.h10
12 files changed, 131 insertions, 66 deletions
diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc
index 1cd0c13..e8e0191 100644
--- a/chrome/browser/autofill/credit_card.cc
+++ b/chrome/browser/autofill/credit_card.cc
@@ -337,6 +337,10 @@ void CreditCard::SetInfo(const AutoFillType& type, const string16& value) {
}
}
+const string16 CreditCard::Label() const {
+ return label_;
+}
+
string16 CreditCard::ObfuscatedNumber() const {
if (number().empty())
return string16(); // No CC number, means empty preview.
diff --git a/chrome/browser/autofill/credit_card.h b/chrome/browser/autofill/credit_card.h
index 9136b5e..ebb3161 100644
--- a/chrome/browser/autofill/credit_card.h
+++ b/chrome/browser/autofill/credit_card.h
@@ -32,7 +32,7 @@ class CreditCard : public FormGroup {
virtual string16 GetFieldText(const AutoFillType& type) const;
virtual string16 GetPreviewText(const AutoFillType& type) const;
virtual void SetInfo(const AutoFillType& type, const string16& value);
- virtual const string16 Label() const { return label_; }
+ virtual const string16 Label() const;
// The number altered for display, for example: ******1234
string16 ObfuscatedNumber() const;
diff --git a/chrome/browser/autofill/fax_number.cc b/chrome/browser/autofill/fax_number.cc
new file mode 100644
index 0000000..06dd781
--- /dev/null
+++ b/chrome/browser/autofill/fax_number.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 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.
+
+#include "chrome/browser/autofill/fax_number.h"
+
+FaxNumber::FaxNumber() {}
+
+FaxNumber::~FaxNumber() {}
+
+FormGroup* FaxNumber::Clone() const {
+ return new FaxNumber(*this);
+}
+
+AutoFillFieldType FaxNumber::GetNumberType() const {
+ return PHONE_FAX_NUMBER;
+}
+
+AutoFillFieldType FaxNumber::GetCityCodeType() const {
+ return PHONE_FAX_CITY_CODE;
+}
+
+AutoFillFieldType FaxNumber::GetCountryCodeType() const {
+ return PHONE_FAX_COUNTRY_CODE;
+}
+
+AutoFillFieldType FaxNumber::GetCityAndNumberType() const {
+ return PHONE_FAX_CITY_AND_NUMBER;
+}
+
+AutoFillFieldType FaxNumber::GetWholeNumberType() const {
+ return PHONE_FAX_WHOLE_NUMBER;
+}
diff --git a/chrome/browser/autofill/fax_number.h b/chrome/browser/autofill/fax_number.h
index 864746f..7fe9a1c 100644
--- a/chrome/browser/autofill/fax_number.h
+++ b/chrome/browser/autofill/fax_number.h
@@ -12,29 +12,17 @@ class FormGroup;
class FaxNumber : public PhoneNumber {
public:
- FaxNumber() {}
- virtual FormGroup* Clone() const { return new FaxNumber(*this); }
+ FaxNumber();
+ virtual ~FaxNumber();
- protected:
- virtual AutoFillFieldType GetNumberType() const {
- return PHONE_FAX_NUMBER;
- }
-
- virtual AutoFillFieldType GetCityCodeType() const {
- return PHONE_FAX_CITY_CODE;
- }
-
- virtual AutoFillFieldType GetCountryCodeType() const {
- return PHONE_FAX_COUNTRY_CODE;
- }
+ virtual FormGroup* Clone() const;
- virtual AutoFillFieldType GetCityAndNumberType() const {
- return PHONE_FAX_CITY_AND_NUMBER;
- }
-
- virtual AutoFillFieldType GetWholeNumberType() const {
- return PHONE_FAX_WHOLE_NUMBER;
- }
+ protected:
+ virtual AutoFillFieldType GetNumberType() const;
+ virtual AutoFillFieldType GetCityCodeType() const;
+ virtual AutoFillFieldType GetCountryCodeType() const;
+ virtual AutoFillFieldType GetCityAndNumberType() const;
+ virtual AutoFillFieldType GetWholeNumberType() const;
private:
explicit FaxNumber(const FaxNumber& phone) : PhoneNumber(phone) {}
diff --git a/chrome/browser/autofill/form_field.cc b/chrome/browser/autofill/form_field.cc
index 95b1e55..6bf3e24 100644
--- a/chrome/browser/autofill/form_field.cc
+++ b/chrome/browser/autofill/form_field.cc
@@ -105,6 +105,10 @@ class EmailField : public FormField {
AutoFillField* field_;
};
+FormFieldType FormField::GetFormFieldType() const {
+ return kOtherFieldType;
+}
+
// static
bool FormField::Match(AutoFillField* field,
const string16& pattern,
diff --git a/chrome/browser/autofill/form_field.h b/chrome/browser/autofill/form_field.h
index 38b2ec2..4c5e02b 100644
--- a/chrome/browser/autofill/form_field.h
+++ b/chrome/browser/autofill/form_field.h
@@ -75,7 +75,7 @@ class FormField {
virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const = 0;
// Returns the type of form field of the class implementing this interface.
- virtual FormFieldType GetFormFieldType() const { return kOtherFieldType; }
+ virtual FormFieldType GetFormFieldType() const;
// 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.
diff --git a/chrome/browser/autofill/home_address.cc b/chrome/browser/autofill/home_address.cc
new file mode 100644
index 0000000..5c036a1
--- /dev/null
+++ b/chrome/browser/autofill/home_address.cc
@@ -0,0 +1,41 @@
+// Copyright (c) 2010 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.
+
+#include "chrome/browser/autofill/home_address.h"
+
+HomeAddress::HomeAddress() {}
+
+HomeAddress::~HomeAddress() {}
+
+FormGroup* HomeAddress::Clone() const {
+ return new HomeAddress(*this);
+}
+
+AutoFillFieldType HomeAddress::GetLine1Type() const {
+ return ADDRESS_HOME_LINE1;
+}
+
+AutoFillFieldType HomeAddress::GetLine2Type() const {
+ return ADDRESS_HOME_LINE2;
+}
+
+AutoFillFieldType HomeAddress::GetAptNumType() const {
+ return ADDRESS_HOME_APT_NUM;
+}
+
+AutoFillFieldType HomeAddress::GetCityType() const {
+ return ADDRESS_HOME_CITY;
+}
+
+AutoFillFieldType HomeAddress::GetStateType() const {
+ return ADDRESS_HOME_STATE;
+}
+
+AutoFillFieldType HomeAddress::GetZipCodeType() const {
+ return ADDRESS_HOME_ZIP;
+}
+
+AutoFillFieldType HomeAddress::GetCountryType() const {
+ return ADDRESS_HOME_COUNTRY;
+}
diff --git a/chrome/browser/autofill/home_address.h b/chrome/browser/autofill/home_address.h
index 3984f6b..9f441f5 100644
--- a/chrome/browser/autofill/home_address.h
+++ b/chrome/browser/autofill/home_address.h
@@ -14,37 +14,18 @@ class FormGroup;
// A specialization of Address that identifies itself as a home address.
class HomeAddress : public Address {
public:
- HomeAddress() {}
- virtual FormGroup* Clone() const { return new HomeAddress(*this); }
+ HomeAddress();
+ virtual ~HomeAddress();
+ virtual FormGroup* Clone() const;
protected:
- virtual AutoFillFieldType GetLine1Type() const {
- return ADDRESS_HOME_LINE1;
- }
-
- virtual AutoFillFieldType GetLine2Type() const {
- return ADDRESS_HOME_LINE2;
- }
-
- virtual AutoFillFieldType GetAptNumType() const {
- return ADDRESS_HOME_APT_NUM;
- }
-
- virtual AutoFillFieldType GetCityType() const {
- return ADDRESS_HOME_CITY;
- }
-
- virtual AutoFillFieldType GetStateType() const {
- return ADDRESS_HOME_STATE;
- }
-
- virtual AutoFillFieldType GetZipCodeType() const {
- return ADDRESS_HOME_ZIP;
- }
-
- virtual AutoFillFieldType GetCountryType() const {
- return ADDRESS_HOME_COUNTRY;
- }
+ virtual AutoFillFieldType GetLine1Type() const;
+ virtual AutoFillFieldType GetLine2Type() const;
+ virtual AutoFillFieldType GetAptNumType() const;
+ virtual AutoFillFieldType GetCityType() const;
+ virtual AutoFillFieldType GetStateType() const;
+ virtual AutoFillFieldType GetZipCodeType() const;
+ virtual AutoFillFieldType GetCountryType() const;
private:
explicit HomeAddress(const HomeAddress& address) : Address(address) {}
diff --git a/chrome/browser/autofill/name_field.cc b/chrome/browser/autofill/name_field.cc
index 8163d7a..69a7b43 100644
--- a/chrome/browser/autofill/name_field.cc
+++ b/chrome/browser/autofill/name_field.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/autofill/name_field.h"
+#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -18,6 +19,12 @@ NameField* NameField::Parse(std::vector<AutoFillField*>::const_iterator* iter,
return field;
}
+bool FullNameField::GetFieldInfo(FieldTypeMap* field_type_map) const {
+ bool ok = Add(field_type_map, field_, AutoFillType(NAME_FULL));
+ DCHECK(ok);
+ return true;
+}
+
FullNameField* FullNameField::Parse(
std::vector<AutoFillField*>::const_iterator* iter) {
// Exclude labels containing the string "username", which typically
@@ -37,6 +44,10 @@ FullNameField* FullNameField::Parse(
return NULL;
}
+FullNameField::FullNameField(AutoFillField* field)
+ : field_(field) {
+}
+
FirstLastNameField* FirstLastNameField::Parse1(
std::vector<AutoFillField*>::const_iterator* iter) {
// Some pages (e.g. Overstock_comBilling.html, SmithsonianCheckout.html)
diff --git a/chrome/browser/autofill/name_field.h b/chrome/browser/autofill/name_field.h
index 7b16e77..0c6bd09 100644
--- a/chrome/browser/autofill/name_field.h
+++ b/chrome/browser/autofill/name_field.h
@@ -8,7 +8,6 @@
#include <vector>
-#include "base/logging.h"
#include "chrome/browser/autofill/autofill_field.h"
#include "chrome/browser/autofill/form_field.h"
@@ -28,17 +27,13 @@ class NameField : public FormField {
// A form field that can parse a full name field.
class FullNameField : public NameField {
public:
- virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const {
- bool ok = Add(field_type_map, field_, AutoFillType(NAME_FULL));
- DCHECK(ok);
- return true;
- }
+ virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const;
static FullNameField* Parse(
std::vector<AutoFillField*>::const_iterator* iter);
private:
- explicit FullNameField(AutoFillField* field) : field_(field) {}
+ explicit FullNameField(AutoFillField* field);
AutoFillField* field_;
DISALLOW_COPY_AND_ASSIGN(FullNameField);
diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc
index 09506b9..8554064 100644
--- a/chrome/browser/autofill/personal_data_manager.cc
+++ b/chrome/browser/autofill/personal_data_manager.cc
@@ -589,6 +589,10 @@ bool PersonalDataManager::HasPassword() {
return !password_hash_.empty();
}
+bool PersonalDataManager::IsDataLoaded() const {
+ return is_data_loaded_;
+}
+
const std::vector<AutoFillProfile*>& PersonalDataManager::profiles() {
// |profile_| is NULL in AutoFillManagerTest.
bool auxiliary_profiles_enabled = profile_ ? profile_->GetPrefs()->GetBoolean(
@@ -611,6 +615,14 @@ const std::vector<AutoFillProfile*>& PersonalDataManager::profiles() {
return profiles_;
}
+const std::vector<AutoFillProfile*>& PersonalDataManager::web_profiles() {
+ return web_profiles_.get();
+}
+
+const std::vector<CreditCard*>& PersonalDataManager::credit_cards() {
+ return credit_cards_.get();
+}
+
AutoFillProfile* PersonalDataManager::CreateNewEmptyAutoFillProfileForDBThread(
const string16& label) {
// See comment in header for thread details.
diff --git a/chrome/browser/autofill/personal_data_manager.h b/chrome/browser/autofill/personal_data_manager.h
index babbe42..f6f9df8 100644
--- a/chrome/browser/autofill/personal_data_manager.h
+++ b/chrome/browser/autofill/personal_data_manager.h
@@ -132,19 +132,15 @@ class PersonalDataManager
bool HasPassword();
// Returns whether the personal data has been loaded from the web database.
- virtual bool IsDataLoaded() const { return is_data_loaded_; }
+ virtual bool IsDataLoaded() const;
// This PersonalDataManager owns these profiles and credit cards. Their
// lifetime is until the web database is updated with new profile and credit
// card information, respectively. |profiles()| returns both web and
// auxiliary profiles. |web_profiles()| returns only web profiles.
const std::vector<AutoFillProfile*>& profiles();
- virtual const std::vector<AutoFillProfile*>& web_profiles() {
- return web_profiles_.get();
- }
- virtual const std::vector<CreditCard*>& credit_cards() {
- return credit_cards_.get();
- }
+ virtual const std::vector<AutoFillProfile*>& web_profiles();
+ virtual const std::vector<CreditCard*>& credit_cards();
// Creates a profile labeled |label|.
// This must be called on the DB thread with the expectation that the