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_HISTORY_HISTORY_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_FACTORY_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/singleton.h" |
| 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" |
| 12 |
| 13 class HistoryService; |
| 14 |
| 15 // Singleton that owns all HistoryService and associates them with |
| 16 // Profiles. |
| 17 class HistoryServiceFactory |
| 18 : public RefcountedProfileKeyedServiceFactory { |
| 19 public: |
| 20 static scoped_refptr<HistoryService> GetForProfile( |
| 21 Profile* profile, Profile::ServiceAccessType sat); |
| 22 |
| 23 static scoped_refptr<HistoryService> GetForProfileIfExists( |
| 24 Profile* profile); |
| 25 |
| 26 static HistoryServiceFactory* GetInstance(); |
| 27 |
| 28 // In the testing profile, we often clear the history before making a new |
| 29 // one. This takes care of that work. It should only be used in tests. |
| 30 // Note: This does not do any cleanup; it only destroys the service. The |
| 31 // calling test is expected to do the cleanup before calling this function. |
| 32 static void ShutdownForProfile(Profile* profile); |
| 33 |
| 34 private: |
| 35 friend struct DefaultSingletonTraits<HistoryServiceFactory>; |
| 36 |
| 37 HistoryServiceFactory(); |
| 38 virtual ~HistoryServiceFactory(); |
| 39 |
| 40 // ProfileKeyedServiceFactory: |
| 41 virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( |
| 42 Profile* profile) const OVERRIDE; |
| 43 virtual bool ServiceRedirectedInIncognito() OVERRIDE; |
| 44 virtual bool ServiceIsNULLWhileTesting() OVERRIDE; |
| 45 }; |
| 46 |
| 47 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_FACTORY_H_ |
OLD | NEW |