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

Side by Side Diff: chrome/browser/webdata/autofill_web_data_service_impl.h

Issue 12851008: Create a common base class for all the webdatas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to committed parent and head. Created 7 years, 9 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_ 5 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_
6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_ 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "chrome/browser/api/webdata/autofill_web_data_service.h" 9 #include "chrome/browser/api/webdata/autofill_web_data_service.h"
10 10
11 class WebDataService; 11 class WebDataService;
12 12
13 // This aggregates a WebDataService and delegates all method calls to 13 // This aggregates a WebDataService and delegates all method calls to
14 // it. 14 // it.
15 class AutofillWebDataServiceImpl : public AutofillWebDataService { 15 class AutofillWebDataServiceImpl : public AutofillWebDataService {
16 public: 16 public:
17 explicit AutofillWebDataServiceImpl(scoped_refptr<WebDataService> service); 17 explicit AutofillWebDataServiceImpl(scoped_refptr<WebDataService> service);
18 virtual ~AutofillWebDataServiceImpl();
19 18
20 // AutofillWebData implementation. 19 // AutofillWebData implementation.
21 virtual void AddFormFields( 20 virtual void AddFormFields(
22 const std::vector<FormFieldData>& fields) OVERRIDE; 21 const std::vector<FormFieldData>& fields) OVERRIDE;
23 virtual WebDataServiceBase::Handle GetFormValuesForElementName( 22 virtual WebDataServiceBase::Handle GetFormValuesForElementName(
24 const string16& name, 23 const string16& name,
25 const string16& prefix, 24 const string16& prefix,
26 int limit, 25 int limit,
27 WebDataServiceConsumer* consumer) OVERRIDE; 26 WebDataServiceConsumer* consumer) OVERRIDE;
28 virtual void RemoveExpiredFormElements() OVERRIDE; 27 virtual void RemoveExpiredFormElements() OVERRIDE;
29 virtual void RemoveFormValueForElementName(const string16& name, 28 virtual void RemoveFormValueForElementName(const string16& name,
30 const string16& value) OVERRIDE; 29 const string16& value) OVERRIDE;
31 virtual void AddAutofillProfile(const AutofillProfile& profile) OVERRIDE; 30 virtual void AddAutofillProfile(const AutofillProfile& profile) OVERRIDE;
32 virtual void UpdateAutofillProfile(const AutofillProfile& profile) OVERRIDE; 31 virtual void UpdateAutofillProfile(const AutofillProfile& profile) OVERRIDE;
33 virtual void RemoveAutofillProfile(const std::string& guid) OVERRIDE; 32 virtual void RemoveAutofillProfile(const std::string& guid) OVERRIDE;
34 virtual WebDataServiceBase::Handle GetAutofillProfiles( 33 virtual WebDataServiceBase::Handle GetAutofillProfiles(
35 WebDataServiceConsumer* consumer) OVERRIDE; 34 WebDataServiceConsumer* consumer) OVERRIDE;
36 virtual void AddCreditCard(const CreditCard& credit_card) OVERRIDE; 35 virtual void AddCreditCard(const CreditCard& credit_card) OVERRIDE;
37 virtual void UpdateCreditCard(const CreditCard& credit_card) OVERRIDE; 36 virtual void UpdateCreditCard(const CreditCard& credit_card) OVERRIDE;
38 virtual void RemoveCreditCard(const std::string& guid) OVERRIDE; 37 virtual void RemoveCreditCard(const std::string& guid) OVERRIDE;
39 virtual WebDataServiceBase::Handle 38 virtual WebDataServiceBase::Handle
40 GetCreditCards(WebDataServiceConsumer* consumer) OVERRIDE; 39 GetCreditCards(WebDataServiceConsumer* consumer) OVERRIDE;
41 40
42 // WebDataServiceBase implementation. 41 // WebDataServiceBase overrides.
42 // TODO(caitkp): remove these when we decouple
43 // WebDatabaseService life cycle from WebData).
43 virtual void CancelRequest(Handle h) OVERRIDE; 44 virtual void CancelRequest(Handle h) OVERRIDE;
44 virtual content::NotificationSource GetNotificationSource() OVERRIDE; 45 virtual content::NotificationSource GetNotificationSource() OVERRIDE;
46 virtual bool IsDatabaseLoaded() OVERRIDE;
47 virtual WebDatabase* GetDatabase() OVERRIDE;
48
49
50 protected:
51 virtual ~AutofillWebDataServiceImpl();
45 52
46 private: 53 private:
47 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataServiceImpl); 54 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataServiceImpl);
48 55
49 const scoped_refptr<WebDataService> service_; 56 const scoped_refptr<WebDataService> service_;
50 }; 57 };
51 58
52 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_ 59 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698