diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 20:47:20 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 20:47:20 +0000 |
commit | f11f6218bd425c87b82656019b27e853b91a40da (patch) | |
tree | d04f086ed6ee7b9f05225c1c5fe4368f77ded947 /chrome/browser/webdata/web_data_service.h | |
parent | d0d281589a8f6d156c37312bef32e6d1f0e5f6e5 (diff) | |
download | chromium_src-f11f6218bd425c87b82656019b27e853b91a40da.zip chromium_src-f11f6218bd425c87b82656019b27e853b91a40da.tar.gz chromium_src-f11f6218bd425c87b82656019b27e853b91a40da.tar.bz2 |
Implement adding, updating and removing credit cards from the web database through the gtk AutoFill dialog.
BUG=18201
TEST=WebDatabaseTest.CreditCard, PersonalDataManagerTest.SetCreditCards
Review URL: http://codereview.chromium.org/555068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37036 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_data_service.h')
-rw-r--r-- | chrome/browser/webdata/web_data_service.h | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index ff356e0..c81061d 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -19,6 +19,7 @@ class AutofillChange; class AutoFillProfile; +class CreditCard; #if defined(OS_WIN) struct IE7PasswordInfo; #endif @@ -54,18 +55,20 @@ struct PasswordForm; // Result types // typedef enum { - BOOL_RESULT = 1, // WDResult<bool> - KEYWORDS_RESULT, // WDResult<WDKeywordsResult> - INT64_RESULT, // WDResult<int64> - PASSWORD_RESULT, // WDResult<std::vector<PasswordForm*>> + BOOL_RESULT = 1, // WDResult<bool> + KEYWORDS_RESULT, // WDResult<WDKeywordsResult> + INT64_RESULT, // WDResult<int64> + PASSWORD_RESULT, // WDResult<std::vector<PasswordForm*>> #if defined(OS_WIN) - PASSWORD_IE7_RESULT, // WDResult<IE7PasswordInfo> + PASSWORD_IE7_RESULT, // WDResult<IE7PasswordInfo> #endif - WEB_APP_IMAGES, // WDResult<WDAppImagesResult> - 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*>> + WEB_APP_IMAGES, // WDResult<WDAppImagesResult> + 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_CREDITCARD_RESULT, // WDResult<CreditCard> + AUTOFILL_CREDITCARDS_RESULT // WDResult<std::vector<CreditCard*>> } WDResultType; typedef std::vector<AutofillChange> AutofillChangeList; @@ -418,18 +421,28 @@ class WebDataService // |profile_id| is the unique ID of the profile to remove. void RemoveAutoFillProfile(int profile_id); - // Initiates the request for an AutoFill profile with label |label|. The - // method OnWebDataServiceRequestDone of |consumer| gets called back when the - // request is finished, with the profile included in the argument |result|. - Handle GetAutoFillProfileForLabel(const string16& label, - WebDataServiceConsumer* consumer); - // 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); + // Schedules a task to add credit card to the web database. + void AddCreditCard(const CreditCard& creditcard); + + // Schedules a task to update credit card in the web database. + void UpdateCreditCard(const CreditCard& creditcard); + + // Schedules a task to remove a credit card from the web database. + // |creditcard_id| is the unique ID of the credit card to remove. + void RemoveCreditCard(int creditcard_id); + + // Initiates the request for all credit cards. The method + // OnWebDataServiceRequestDone of |consumer| gets called when the request is + // finished, with the credit cards included in the argument |result|. The + // consumer owns the credit cards. + Handle GetCreditCards(WebDataServiceConsumer* consumer); + // Testing #ifdef UNIT_TEST void set_failed_init(bool value) { failed_init_ = value; } @@ -531,6 +544,12 @@ class WebDataService void GetAutoFillProfileForLabelImpl(WebDataRequest* request, const string16& label); void GetAutoFillProfilesImpl(WebDataRequest* request); + void AddCreditCardImpl(GenericRequest<CreditCard>* request); + void UpdateCreditCardImpl(GenericRequest<CreditCard>* request); + void RemoveCreditCardImpl(GenericRequest<int>* request); + void GetCreditCardForLabelImpl(WebDataRequest* request, + const string16& label); + void GetCreditCardsImpl(WebDataRequest* request); ////////////////////////////////////////////////////////////////////////////// // |