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

Side by Side Diff: chrome/browser/api/webdata/autofill_web_data.h

Issue 10908065: Introduce a couple of abstract bases for WebDataService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gypi file Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_
6 #define CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/memory/scoped_ptr.h"
12 #include "base/string16.h"
13 #include "chrome/browser/api/webdata/web_data_service_base.h"
14
15 namespace content {
16 class BrowserContext;
erikwright (departed) 2012/09/13 13:28:10 nit: move to autofill_web_data_service.h
Jói 2012/09/13 14:48:53 Done.
17 }
18
19 namespace webkit {
20 namespace forms {
21 struct FormField;
22 }
23 }
24
25 class AutofillProfile;
26 class CreditCard;
27 class Profile;
28 class WebDataServiceConsumer;
29
30 // Pure virtual interface for retrieving Autofill data. API users
31 // should use AutofillWebDataService.
32 class AutofillWebData {
33 public:
34 virtual ~AutofillWebData() {}
35
36 // Schedules a task to add form fields to the web database.
37 virtual void AddFormFields(
38 const std::vector<webkit::forms::FormField>& fields) = 0;
39
40 // Initiates the request for a vector of values which have been entered in
41 // form input fields named |name|. The method OnWebDataServiceRequestDone of
42 // |consumer| gets called back when the request is finished, with the vector
43 // included in the argument |result|.
44 virtual WebDataServiceBase::Handle GetFormValuesForElementName(
45 const string16& name,
46 const string16& prefix,
47 int limit,
48 WebDataServiceConsumer* consumer) = 0;
49
50 virtual void RemoveExpiredFormElements() = 0;
51 virtual void RemoveFormValueForElementName(const string16& name,
52 const string16& value) = 0;
53
54 // Schedules a task to add an Autofill profile to the web database.
55 virtual void AddAutofillProfile(const AutofillProfile& profile) = 0;
56
57 // Schedules a task to update an Autofill profile in the web database.
58 virtual void UpdateAutofillProfile(const AutofillProfile& profile) = 0;
59
60 // Schedules a task to remove an Autofill profile from the web database.
61 // |guid| is the identifer of the profile to remove.
62 virtual void RemoveAutofillProfile(const std::string& guid) = 0;
63
64 // Initiates the request for all Autofill profiles. The method
65 // OnWebDataServiceRequestDone of |consumer| gets called when the request is
66 // finished, with the profiles included in the argument |result|. The
67 // consumer owns the profiles.
68 virtual WebDataServiceBase::Handle GetAutofillProfiles(
69 WebDataServiceConsumer* consumer) = 0;
70
71 // Remove "trashed" profile guids from the web database and optionally send
72 // notifications to tell Sync that the items have been removed.
73 virtual void EmptyMigrationTrash(bool notify_sync) = 0;
74
75 // Schedules a task to add credit card to the web database.
76 virtual void AddCreditCard(const CreditCard& credit_card) = 0;
77
78 // Schedules a task to update credit card in the web database.
79 virtual void UpdateCreditCard(const CreditCard& credit_card) = 0;
80
81 // Schedules a task to remove a credit card from the web database.
82 // |guid| is identifer of the credit card to remove.
83 virtual void RemoveCreditCard(const std::string& guid) = 0;
84
85 // Initiates the request for all credit cards. The method
86 // OnWebDataServiceRequestDone of |consumer| gets called when the request is
87 // finished, with the credit cards included in the argument |result|. The
88 // consumer owns the credit cards.
89 virtual WebDataServiceBase::Handle
90 GetCreditCards(WebDataServiceConsumer* consumer) = 0;
91 };
92
93 #endif // CHROME_BROWSER_API_WEBDATA_AUTOFILL_WEB_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698