Index: chrome/browser/webdata/web_data_service.h |
diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h |
index f66d9dc14c9019f69ed038d546e49f09c1296e1b..7db7cafd59c6344e3523b35dea2ef1e5e734167e 100644 |
--- a/chrome/browser/webdata/web_data_service.h |
+++ b/chrome/browser/webdata/web_data_service.h |
@@ -23,14 +23,10 @@ |
#include "chrome/browser/api/webdata/web_data_results.h" |
#include "chrome/browser/api/webdata/web_data_service_base.h" |
#include "chrome/browser/api/webdata/web_data_service_consumer.h" |
-#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" |
#include "chrome/browser/search_engines/template_url.h" |
#include "chrome/browser/search_engines/template_url_id.h" |
#include "chrome/browser/webdata/keyword_table.h" |
-#include "chrome/browser/webdata/web_data_request_manager.h" |
#include "chrome/browser/webdata/web_database.h" |
-#include "content/public/browser/browser_thread.h" |
-#include "sql/init_status.h" |
class AutocompleteSyncableService; |
class AutofillChange; |
@@ -105,18 +101,13 @@ class WebDataServiceConsumer; |
class WebDataService |
: public WebDataServiceBase, |
- public AutofillWebData, |
- public RefcountedProfileKeyedService { |
+ public AutofillWebData { |
public: |
// Retrieve a WebDataService for the given context. |
static scoped_refptr<WebDataService> FromBrowserContext( |
content::BrowserContext* context); |
- WebDataService(); |
- |
- // WebDataServiceBase implementation. |
- virtual void CancelRequest(Handle h) OVERRIDE; |
- virtual content::NotificationSource GetNotificationSource() OVERRIDE; |
+ explicit WebDataService(const ProfileErrorCallback& callback); |
// Notifies listeners on the UI thread that multiple changes have been made to |
// to Autofill records of the database. |
@@ -125,29 +116,7 @@ class WebDataService |
// |web_data_service| may be NULL for testing purposes. |
static void NotifyOfMultipleAutofillChanges(WebDataService* web_data_service); |
- // RefcountedProfileKeyedService override: |
- // Shutdown the web data service. The service can no longer be used after this |
- // call. |
- virtual void ShutdownOnUIThread() OVERRIDE; |
- |
- // Initializes the web data service. |
- void Init(const base::FilePath& path); |
- |
- // Unloads the database without actually shutting down the service. This can |
- // be used to temporarily reduce the browser process' memory footprint. |
- void UnloadDatabase(); |
- |
- // Unloads the database permanently and shuts down service. |
- void ShutdownDatabase(); |
- // Returns true if the database load has completetd successfully, and |
- // ShutdownOnUIThread has not yet been called. |
- virtual bool IsDatabaseLoaded(); |
- |
- // Returns a pointer to the DB (used by SyncableServices). May return NULL if |
- // the database is not loaded or otherwise unavailable. Must be called on |
- // DBThread. |
- virtual WebDatabase* GetDatabase(); |
////////////////////////////////////////////////////////////////////////////// |
// |
@@ -316,43 +285,24 @@ class WebDataService |
void RemoveFormElementsAddedBetween(const base::Time& delete_begin, |
const base::Time& delete_end); |
- // Returns the syncable service for Autofill addresses and credit cards stored |
- // in this table. The returned service is owned by |this| object. |
- virtual AutofillProfileSyncableService* |
- GetAutofillProfileSyncableService() const; |
- |
- // Returns the syncable service for field autocomplete stored in this table. |
- // The returned service is owned by |this| object. |
- virtual AutocompleteSyncableService* |
- GetAutocompleteSyncableService() const; |
- |
protected: |
+ // TODO(caitkp): We probably don't need these anymore. |
friend class TemplateURLServiceTest; |
friend class TemplateURLServiceTestingProfile; |
friend class WebDataServiceTest; |
friend class WebDataRequest; |
+ // For unit tests, passes a null callback. |
+ WebDataService(); |
+ |
virtual ~WebDataService(); |
+ private: |
////////////////////////////////////////////////////////////////////////////// |
// |
// The following methods are only invoked in the web data service thread. |
// |
////////////////////////////////////////////////////////////////////////////// |
- private: |
- friend struct content::BrowserThread::DeleteOnThread< |
- content::BrowserThread::UI>; |
- friend class base::DeleteHelper<WebDataService>; |
- |
- // Initialize any syncable services. |
- void InitializeSyncableServices(); |
- |
- // Deletes the syncable services. |
- void ShutdownSyncableServices(); |
- |
- void DBInitFailed(sql::InitStatus sql_status); |
- void NotifyDatabaseLoadedOnUIThread(); |
- void DatabaseInitOnDB(sql::InitStatus status); |
////////////////////////////////////////////////////////////////////////////// |
// |
@@ -472,20 +422,6 @@ class WebDataService |
void DestroyAutofillProfileResult(const WDTypedResult* result); |
void DestroyAutofillCreditCardResult(const WDTypedResult* result); |
- // Our database service. |
- scoped_ptr<WebDatabaseService> wdbs_; |
- |
- // True if we've received a notification that the WebDatabase has loaded. |
- bool db_loaded_; |
- |
- // Syncable services for the database data. We own the services, but don't |
- // use |scoped_ptr|s because the lifetimes must be managed on the database |
- // thread. |
- // Currently only Autocomplete and Autofill profiles use the new Sync API, but |
- // all the database data should migrate to this API over time. |
- AutocompleteSyncableService* autocomplete_syncable_service_; |
- AutofillProfileSyncableService* autofill_profile_syncable_service_; |
- |
DISALLOW_COPY_AND_ASSIGN(WebDataService); |
}; |