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

Side by Side Diff: components/autofill/browser/webdata/autofill_webdata_backend_impl.h

Issue 14081043: Hook up Autofill Backend interface to SyncableServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 7 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_BROWSER_WEBDATA_AUTOFILL_WEBDATA_BACKEND_IMPL_H_ 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_WEBDATA_AUTOFILL_WEBDATA_BACKEND_IMPL_H_
6 #define COMPONENTS_AUTOFILL_BROWSER_WEBDATA_AUTOFILL_WEBDATA_BACKEND_IMPL_H_ 6 #define COMPONENTS_AUTOFILL_BROWSER_WEBDATA_AUTOFILL_WEBDATA_BACKEND_IMPL_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 AutofillWebDataBackendImpl( 42 AutofillWebDataBackendImpl(
43 scoped_refptr<WebDataServiceBackend> web_database_backend, 43 scoped_refptr<WebDataServiceBackend> web_database_backend,
44 const base::Closure& on_changed_callback); 44 const base::Closure& on_changed_callback);
45 45
46 // AutofillWebDataBackend implementation. 46 // AutofillWebDataBackend implementation.
47 virtual void AddObserver(AutofillWebDataServiceObserverOnDBThread* observer) 47 virtual void AddObserver(AutofillWebDataServiceObserverOnDBThread* observer)
48 OVERRIDE; 48 OVERRIDE;
49 virtual void RemoveObserver( 49 virtual void RemoveObserver(
50 AutofillWebDataServiceObserverOnDBThread* observer) OVERRIDE; 50 AutofillWebDataServiceObserverOnDBThread* observer) OVERRIDE;
51 virtual WebDatabase* GetDatabase() OVERRIDE; 51 virtual WebDatabase* GetDatabase() OVERRIDE;
52 virtual void RemoveExpiredFormElementsWrapper() OVERRIDE; 52 virtual void RemoveExpiredFormElements() OVERRIDE;
53 virtual void NotifyOfMultipleAutofillChanges() OVERRIDE; 53 virtual void NotifyOfMultipleAutofillChanges() OVERRIDE;
54 54
55 // Adds form fields to the web database. 55 // Adds form fields to the web database.
56 WebDatabase::State AddFormElements(const std::vector<FormFieldData>& fields, 56 WebDatabase::State AddFormElements(const std::vector<FormFieldData>& fields,
57 WebDatabase* db); 57 WebDatabase* db);
58 58
59 // Returns a vector of values which have been entered in form input fields 59 // Returns a vector of values which have been entered in form input fields
60 // named |name|. 60 // named |name|.
61 scoped_ptr<WDTypedResult> GetFormValuesForElementName( 61 scoped_ptr<WDTypedResult> GetFormValuesForElementName(
62 const base::string16& name, 62 const base::string16& name,
63 const base::string16& prefix, 63 const base::string16& prefix,
64 int limit, 64 int limit,
65 WebDatabase* db); 65 WebDatabase* db);
66 66
67 // Returns true if there are any elements in the form. 67 // Returns true if there are any elements in the form.
68 scoped_ptr<WDTypedResult> HasFormElements(WebDatabase* db); 68 scoped_ptr<WDTypedResult> HasFormElements(WebDatabase* db);
69 69
70 // Removes form elements recorded for Autocomplete from the database. 70 // Removes form elements recorded for Autocomplete from the database.
71 WebDatabase::State RemoveFormElementsAddedBetween( 71 WebDatabase::State RemoveFormElementsAddedBetween(
72 const base::Time& delete_begin, 72 const base::Time& delete_begin,
73 const base::Time& delete_end, 73 const base::Time& delete_end,
74 WebDatabase* db); 74 WebDatabase* db);
75 75
76 // Removes expired form elements recorded for Autocomplete from the database.
77 WebDatabase::State RemoveExpiredFormElements(WebDatabase* db);
78 76
79 // Removes the Form-value |value| which has been entered in form input fields 77 // Removes the Form-value |value| which has been entered in form input fields
80 // named |name| from the database. 78 // named |name| from the database.
81 WebDatabase::State RemoveFormValueForElementName(const base::string16& name, 79 WebDatabase::State RemoveFormValueForElementName(const base::string16& name,
82 const base::string16& value, 80 const base::string16& value,
83 WebDatabase* db); 81 WebDatabase* db);
84 82
85 // Adds an Autofill profile to the web database. 83 // Adds an Autofill profile to the web database.
86 WebDatabase::State AddAutofillProfile(const AutofillProfile& profile, 84 WebDatabase::State AddAutofillProfile(const AutofillProfile& profile,
87 WebDatabase* db); 85 WebDatabase* db);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 121
124 private: 122 private:
125 friend struct content::BrowserThread::DeleteOnThread< 123 friend struct content::BrowserThread::DeleteOnThread<
126 content::BrowserThread::DB>; 124 content::BrowserThread::DB>;
127 friend class base::DeleteHelper<AutofillWebDataBackendImpl>; 125 friend class base::DeleteHelper<AutofillWebDataBackendImpl>;
128 // We have to friend RCTS<> so WIN shared-lib build is happy 126 // We have to friend RCTS<> so WIN shared-lib build is happy
129 // (http://crbug/112250). 127 // (http://crbug/112250).
130 friend class base::RefCountedThreadSafe<AutofillWebDataBackendImpl, 128 friend class base::RefCountedThreadSafe<AutofillWebDataBackendImpl,
131 content::BrowserThread::DeleteOnDBThread>; 129 content::BrowserThread::DeleteOnDBThread>;
132 130
131 WebDatabase::State RemoveExpiredFormElementsImpl(WebDatabase* db);
132
133 // Callbacks to ensure that sensitive info is destroyed if request is 133 // Callbacks to ensure that sensitive info is destroyed if request is
134 // cancelled. 134 // cancelled.
135 void DestroyAutofillProfileResult(const WDTypedResult* result); 135 void DestroyAutofillProfileResult(const WDTypedResult* result);
136 void DestroyAutofillCreditCardResult(const WDTypedResult* result); 136 void DestroyAutofillCreditCardResult(const WDTypedResult* result);
137 137
138 ObserverList<AutofillWebDataServiceObserverOnDBThread> db_observer_list_; 138 ObserverList<AutofillWebDataServiceObserverOnDBThread> db_observer_list_;
139 139
140 // WebDataServiceBackend allows direct access to DB. 140 // WebDataServiceBackend allows direct access to DB.
141 // TODO(caitkp): Make it so nobody but us needs direct DB access anymore. 141 // TODO(caitkp): Make it so nobody but us needs direct DB access anymore.
142 scoped_refptr<WebDataServiceBackend> web_database_backend_; 142 scoped_refptr<WebDataServiceBackend> web_database_backend_;
143 143
144 base::Closure on_changed_callback_; 144 base::Closure on_changed_callback_;
145 145
146 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataBackendImpl); 146 DISALLOW_COPY_AND_ASSIGN(AutofillWebDataBackendImpl);
147 }; 147 };
148 148
149 } // namespace autofill 149 } // namespace autofill
150 150
151 #endif // COMPONENTS_AUTOFILL_BROWSER_WEBDATA_AUTOFILL_WEBDATA_BACKEND_IMPL_H_ 151 #endif // COMPONENTS_AUTOFILL_BROWSER_WEBDATA_AUTOFILL_WEBDATA_BACKEND_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698