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

Unified Diff: chrome/browser/autofill/address.cc

Issue 2818033: AutoFill: Aggregate profile data. Remove the AutoFill InfoBar. (Closed)
Patch Set: Comment. Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/address.h ('k') | chrome/browser/autofill/autofill_common_unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/address.cc
diff --git a/chrome/browser/autofill/address.cc b/chrome/browser/autofill/address.cc
index e84e3e2e31cb26194f8c9bba29264eab3fef7d21..cd5358e63fb5082f7b417fd91e382e880b558bd0 100644
--- a/chrome/browser/autofill/address.cc
+++ b/chrome/browser/autofill/address.cc
@@ -30,8 +30,6 @@ const int kAutoFillAddressLength = arraysize(kAutoFillAddressTypes);
void Address::GetPossibleFieldTypes(const string16& text,
FieldTypeSet* possible_types) const {
DCHECK(possible_types);
- if (!possible_types)
- return;
// If the text to match against the field types is empty, then no results will
// match.
@@ -60,12 +58,35 @@ void Address::GetPossibleFieldTypes(const string16& text,
possible_types->insert(GetCountryType());
}
+void Address::GetAvailableFieldTypes(FieldTypeSet* available_types) const {
+ DCHECK(available_types);
+
+ if (!line1().empty())
+ available_types->insert(GetLine1Type());
+
+ if (!line2().empty())
+ available_types->insert(GetLine2Type());
+
+ if (!apt_num().empty())
+ available_types->insert(GetAptNumType());
+
+ if (!city().empty())
+ available_types->insert(GetCityType());
+
+ if (!state().empty())
+ available_types->insert(GetStateType());
+
+ if (!zip_code().empty())
+ available_types->insert(GetZipCodeType());
+
+ if (!country().empty())
+ available_types->insert(GetCountryType());
+}
+
void Address::FindInfoMatches(const AutoFillType& type,
const string16& info,
std::vector<string16>* matched_text) const {
DCHECK(matched_text);
- if (!matched_text)
- return;
string16 match;
if (type.field_type() == UNKNOWN_TYPE) {
« no previous file with comments | « chrome/browser/autofill/address.h ('k') | chrome/browser/autofill/autofill_common_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698