Chromium Code Reviews| Index: components/autofill/browser/webdata/syncable_service_delegate.h |
| diff --git a/components/autofill/browser/webdata/syncable_service_delegate.h b/components/autofill/browser/webdata/syncable_service_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8bd49b07c3ddd4638a53400ce1b7bf548287bd55 |
| --- /dev/null |
| +++ b/components/autofill/browser/webdata/syncable_service_delegate.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_AUTOFILL_BROWSER_WEBDATA_SYNCABLE_SERVICE_DELEGATE_H_ |
| +#define COMPONENTS_AUTOFILL_BROWSER_WEBDATA_SYNCABLE_SERVICE_DELEGATE_H_ |
| + |
| +class WebDatabase; |
| + |
| +namespace autofill { |
| + |
| +class AutofillWebDataBackend; |
| +class AutofillWebDataServiceObserverOnDBThread; |
| + |
| +// Delegate class for doing Autofill work directly on the DB thread (used by |
| +// Sync, mostly), without fully exposing the AutofillWebDataBackend to clients. |
| +class SyncableServiceDelegate { |
|
Ilya Sherman
2013/05/07 00:02:43
I'm still trying to wrap my mind around what this
Cait (Slow)
2013/05/07 19:22:07
Done.
|
| + public: |
| + virtual ~SyncableServiceDelegate() {} |
| + |
| + virtual WebDatabase* GetDatabase() = 0; |
| + |
| + // Add an observer to |autofill_backend_|. |
|
Ilya Sherman
2013/05/07 00:02:43
nit: This class doesn't have an |autofill_backend_
Cait (Slow)
2013/05/07 19:22:07
Done.
|
| + virtual void AddObserver( |
| + AutofillWebDataServiceObserverOnDBThread* observer) = 0; |
| + |
| + // Remove an observer from |autofill_backend_|. |
|
Ilya Sherman
2013/05/07 00:02:43
Ditto.
Cait (Slow)
2013/05/07 19:22:07
Done.
|
| + virtual void RemoveObserver( |
| + AutofillWebDataServiceObserverOnDBThread* observer) = 0; |
| + |
| + // Remove expired elements from |web_database_| and commit if needed. |
| + virtual void RemoveExpiredFormElements() = 0; |
| + |
| + // Notifies listeners on the UI thread that multiple changes have been made to |
| + // to Autofill records of the database. |
| + // NOTE: This method is intended to be called from the DB thread. It |
| + // it asynchronously notifies listeners on the UI thread. |
| + // |web_data_service| may be NULL for testing purposes. |
| + virtual void NotifyOfMultipleAutofillChanges() = 0; |
| +}; |
| + |
| +} // autofill |
| + |
| +#endif //COMPONENTS_AUTOFILL_BROWSER_WEBDATA_SYNCABLE_SERVICE_DELEGATE_H_ |