From 2a958550ec25aeb2da7fa893015133f2aae32f41 Mon Sep 17 00:00:00 2001 From: "isherman@chromium.org" Date: Thu, 5 May 2011 04:01:21 +0000 Subject: Refactor Autofill parsing code. Most notably, add a helper class for parsing with lookahead. * Adds an AutofillScanner class to help with lookahead parsing. * Remove the NULL-termination from FormStructure's fields vector * Remove some redundant DCHECKs * Refactor PersonalDataManager::ImportFormData() to take a single form, not a vector of forms. * Move EmailField class to its own file * Remove some obsolete billing/shipping address distinguishing code * Refactor the code to remove the really wonky FormFieldSet() class * Refactor some interfaces to take |size_t| rather than |int| * Remove some unused fields from FormStructure * Const-correctness BUG=none TEST=none Review URL: http://codereview.chromium.org/6910018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84211 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autofill/personal_data_manager.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'chrome/browser/autofill/personal_data_manager.h') diff --git a/chrome/browser/autofill/personal_data_manager.h b/chrome/browser/autofill/personal_data_manager.h index 7b6299a..d98420c 100644 --- a/chrome/browser/autofill/personal_data_manager.h +++ b/chrome/browser/autofill/personal_data_manager.h @@ -9,6 +9,7 @@ #include #include +#include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" @@ -63,12 +64,12 @@ class PersonalDataManager // ProfileSyncServiceObserver: virtual void OnStateChanged(); - // TODO(isherman): Update this comment - // If Autofill is able to determine the field types of a significant number of - // field types that contain information in the FormStructures a profile will - // be created with all of the information from recognized fields. Returns - // whether a profile was created. - bool ImportFormData(const std::vector& form_structures, + // Scans the given |form| for importable Autofill data. If the form includes + // sufficient address data, it is immediately imported. If the form includes + // sufficient credit card data, it is stored into |credit_card|, so that we + // can prompt the user whether to save this data. + // Returns |true| if sufficient address or credit card data was found. + bool ImportFormData(const FormStructure& form, const CreditCard** credit_card); // Saves a credit card value detected in |ImportedFormData|. -- cgit v1.1