OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_FACTORY_H__ |
| 6 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_FACTORY_H__ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/memory/singleton.h" |
| 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" |
| 13 |
| 14 class WebDataService; |
| 15 |
| 16 class WebDataServiceFactory : public RefcountedProfileKeyedServiceFactory { |
| 17 public: |
| 18 // Returns the |WebDataService| associated with the |profile|. |
| 19 // |access_type| is either EXPLICIT_ACCESS or IMPLICIT_ACCESS |
| 20 // (see its definition). |
| 21 static scoped_refptr<WebDataService> GetForProfile( |
| 22 Profile* profile, Profile::ServiceAccessType access_type); |
| 23 |
| 24 // Similar to GetForProfile(), but won't create the web data service if it |
| 25 // doesn't already exist. |
| 26 static scoped_refptr<WebDataService> GetForProfileIfExists( |
| 27 Profile* profile, Profile::ServiceAccessType access_type); |
| 28 |
| 29 static WebDataServiceFactory* GetInstance(); |
| 30 |
| 31 private: |
| 32 friend struct DefaultSingletonTraits<WebDataServiceFactory>; |
| 33 |
| 34 WebDataServiceFactory(); |
| 35 virtual ~WebDataServiceFactory(); |
| 36 |
| 37 // |ProfileKeyedBaseFactory| methods: |
| 38 virtual bool ServiceRedirectedInIncognito() OVERRIDE; |
| 39 virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( |
| 40 Profile* profile) const OVERRIDE; |
| 41 virtual bool ServiceIsNULLWhileTesting() OVERRIDE; |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_FACTORY_H__ |
OLD | NEW |