| Index: chrome/browser/webdata/web_data_service_factory.h
|
| diff --git a/chrome/browser/webdata/web_data_service_factory.h b/chrome/browser/webdata/web_data_service_factory.h
|
| index fe4ef6b14b66421693ae3cdf9a9c678732276a79..153a41fd85783dd33d6fcb5e7d482d65c791fa89 100644
|
| --- a/chrome/browser/webdata/web_data_service_factory.h
|
| +++ b/chrome/browser/webdata/web_data_service_factory.h
|
| @@ -6,13 +6,36 @@
|
| #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_FACTORY_H__
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/memory/ref_counted.h"
|
| #include "base/memory/singleton.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h"
|
| +#include "chrome/browser/profiles/profile_keyed_service_factory.h"
|
| +#include "chrome/browser/webdata/web_data_service.h"
|
|
|
| -class WebDataService;
|
| +// A wrapper of WebDataService so that we can use it as a profile keyed service.
|
| +class WebDataServiceWrapper : public ProfileKeyedService {
|
| + public:
|
| + explicit WebDataServiceWrapper(Profile* profile);
|
| +
|
| + // For testing.
|
| + WebDataServiceWrapper();
|
| +
|
| + virtual ~WebDataServiceWrapper();
|
| +
|
| + // ProfileKeyedService:
|
| + virtual void Shutdown() OVERRIDE;
|
| +
|
| + virtual scoped_refptr<WebDataService> GetWebData();
|
|
|
| -class WebDataServiceFactory : public RefcountedProfileKeyedServiceFactory {
|
| + private:
|
| + scoped_refptr<WebDataService> web_data_service_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(WebDataServiceWrapper);
|
| +};
|
| +
|
| +// Singleton that owns all WebDataServiceWrappers and associates them with
|
| +// Profiles.
|
| +class WebDataServiceFactory : public ProfileKeyedServiceFactory {
|
| public:
|
| // Returns the |WebDataService| associated with the |profile|.
|
| // |access_type| is either EXPLICIT_ACCESS or IMPLICIT_ACCESS
|
| @@ -33,9 +56,11 @@ class WebDataServiceFactory : public RefcountedProfileKeyedServiceFactory {
|
|
|
| // |ProfileKeyedBaseFactory| methods:
|
| virtual bool ServiceRedirectedInIncognito() const OVERRIDE;
|
| - virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor(
|
| + virtual ProfileKeyedService* BuildServiceInstanceFor(
|
| Profile* profile) const OVERRIDE;
|
| virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(WebDataServiceFactory);
|
| };
|
|
|
| #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_FACTORY_H__
|
|
|