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

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

Issue 12937016: Rename AutofillWebDataServiceImpl --> AutofillWebDataService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More clean up 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_H_
6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_ 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_H_
7
8 #include <vector>
7 9
8 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
9 #include "chrome/browser/api/webdata/autofill_web_data_service.h" 11 #include "chrome/browser/api/webdata/autofill_web_data.h"
10 #include "chrome/browser/api/webdata/web_data_results.h" 12 #include "chrome/browser/api/webdata/web_data_results.h"
11 #include "chrome/browser/api/webdata/web_data_service_base.h" 13 #include "chrome/browser/api/webdata/web_data_service_base.h"
12 #include "chrome/browser/api/webdata/web_data_service_consumer.h" 14 #include "chrome/browser/api/webdata/web_data_service_consumer.h"
13 #include "chrome/browser/webdata/web_database.h" 15 #include "chrome/browser/webdata/web_database.h"
14 16
15 class AutofillChange; 17 class AutofillChange;
16 class WebDatabaseService; 18 class WebDatabaseService;
17 19
18 // This aggregates a WebDataService and delegates all method calls to 20 namespace content {
19 // it. 21 class BrowserContext;
20 class AutofillWebDataServiceImpl : public AutofillWebDataService { 22 }
23
24 typedef std::vector<AutofillChange> AutofillChangeList;
25
26 // API for Autofill web data.
27 class AutofillWebDataService
28 : public AutofillWebData,
29 public WebDataServiceBase {
21 public: 30 public:
22 AutofillWebDataServiceImpl(scoped_refptr<WebDatabaseService> wdbs, 31 AutofillWebDataService();
23 const ProfileErrorCallback& callback); 32
33 AutofillWebDataService(scoped_refptr<WebDatabaseService> wdbs,
34 const ProfileErrorCallback& callback);
35
36 // Retrieve an AutofillWebDataService for the given context.
37 //
dhollowa 2013/03/26 15:12:54 nit: no need for empty comment line.
38 // Can return NULL in some contexts.
39 static scoped_refptr<AutofillWebDataService> FromBrowserContext(
40 content::BrowserContext* context);
41
42 // Notifies listeners on the UI thread that multiple changes have been made to
43 // to Autofill records of the database.
44 // NOTE: This method is intended to be called from the DB thread. It
45 // it asynchronously notifies listeners on the UI thread.
46 // |web_data_service| may be NULL for testing purposes.
47 static void NotifyOfMultipleAutofillChanges(
48 AutofillWebDataService* web_data_service);
24 49
25 // WebDataServiceBase overrides: 50 // WebDataServiceBase overrides:
26 virtual content::NotificationSource GetNotificationSource() OVERRIDE; 51 virtual content::NotificationSource GetNotificationSource() OVERRIDE;
27 52
28 // AutofillWebData implementation. 53 // AutofillWebData implementation.
29 virtual void AddFormFields( 54 virtual void AddFormFields(
30 const std::vector<FormFieldData>& fields) OVERRIDE; 55 const std::vector<FormFieldData>& fields) OVERRIDE;
31 virtual WebDataServiceBase::Handle GetFormValuesForElementName( 56 virtual WebDataServiceBase::Handle GetFormValuesForElementName(
32 const string16& name, 57 const string16& name,
33 const string16& prefix, 58 const string16& prefix,
(...skipping 12 matching lines...) Expand all
46 virtual void AddCreditCard(const CreditCard& credit_card) OVERRIDE; 71 virtual void AddCreditCard(const CreditCard& credit_card) OVERRIDE;
47 virtual void UpdateCreditCard(const CreditCard& credit_card) OVERRIDE; 72 virtual void UpdateCreditCard(const CreditCard& credit_card) OVERRIDE;
48 virtual void RemoveCreditCard(const std::string& guid) OVERRIDE; 73 virtual void RemoveCreditCard(const std::string& guid) OVERRIDE;
49 virtual WebDataServiceBase::Handle GetCreditCards( 74 virtual WebDataServiceBase::Handle GetCreditCards(
50 WebDataServiceConsumer* consumer) OVERRIDE; 75 WebDataServiceConsumer* consumer) OVERRIDE;
51 virtual void RemoveAutofillDataModifiedBetween( 76 virtual void RemoveAutofillDataModifiedBetween(
52 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; 77 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE;
53 78
54 79
55 protected: 80 protected:
56 virtual ~AutofillWebDataServiceImpl(); 81 virtual ~AutofillWebDataService();
57 82
58 private: 83 private:
59 WebDatabase::State AddFormElementsImpl( 84 WebDatabase::State AddFormElementsImpl(
60 const std::vector<FormFieldData>& fields, WebDatabase* db); 85 const std::vector<FormFieldData>& fields, WebDatabase* db);
61 scoped_ptr<WDTypedResult> GetFormValuesForElementNameImpl( 86 scoped_ptr<WDTypedResult> GetFormValuesForElementNameImpl(
62 const string16& name, const string16& prefix, int limit, WebDatabase* db); 87 const string16& name, const string16& prefix, int limit, WebDatabase* db);
63 WebDatabase::State RemoveFormElementsAddedBetweenImpl( 88 WebDatabase::State RemoveFormElementsAddedBetweenImpl(
64 const base::Time& delete_begin, const base::Time& delete_end, 89 const base::Time& delete_begin, const base::Time& delete_end,
65 WebDatabase* db); 90 WebDatabase* db);
66 WebDatabase::State RemoveExpiredFormElementsImpl(WebDatabase* db); 91 WebDatabase::State RemoveExpiredFormElementsImpl(WebDatabase* db);
(...skipping 15 matching lines...) Expand all
82 scoped_ptr<WDTypedResult> GetCreditCardsImpl(WebDatabase* db); 107 scoped_ptr<WDTypedResult> GetCreditCardsImpl(WebDatabase* db);
83 WebDatabase::State RemoveAutofillDataModifiedBetweenImpl( 108 WebDatabase::State RemoveAutofillDataModifiedBetweenImpl(
84 const base::Time& delete_begin, const base::Time& delete_end, 109 const base::Time& delete_begin, const base::Time& delete_end,
85 WebDatabase* db); 110 WebDatabase* db);
86 111
87 // Callbacks to ensure that sensitive info is destroyed if request is 112 // Callbacks to ensure that sensitive info is destroyed if request is
88 // cancelled. 113 // cancelled.
89 void DestroyAutofillProfileResult(const WDTypedResult* result); 114 void DestroyAutofillProfileResult(const WDTypedResult* result);
90 void DestroyAutofillCreditCardResult(const WDTypedResult* result); 115 void DestroyAutofillCreditCardResult(const WDTypedResult* result);
91 116
92 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataServiceImpl); 117 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataService);
93 }; 118 };
94 119
95 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_IMPL_H_ 120 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_WEB_DATA_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/webdata/autofill_profile_syncable_service.cc ('k') | chrome/browser/webdata/autofill_web_data_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698