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_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/singleton.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" |
| 11 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 12 |
| 13 class ExtensionSystem; |
| 14 class Profile; |
| 15 class ProfileKeyedService; |
| 16 |
| 17 // ProfileKeyedServiceFactory for ExtensionSystemImpl::Delegate. |
| 18 // Should not be used except by ExtensionSystem(Factory). |
| 19 class ExtensionSystemDelegateFactory : public ProfileKeyedServiceFactory { |
| 20 public: |
| 21 static ExtensionSystemImpl::Delegate* GetForProfile(Profile* profile); |
| 22 |
| 23 static ExtensionSystemDelegateFactory* GetInstance(); |
| 24 |
| 25 virtual void ProfileShutdown(Profile* profile) OVERRIDE; |
| 26 |
| 27 private: |
| 28 friend struct DefaultSingletonTraits<ExtensionSystemDelegateFactory>; |
| 29 |
| 30 ExtensionSystemDelegateFactory(); |
| 31 virtual ~ExtensionSystemDelegateFactory(); |
| 32 |
| 33 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 34 Profile* profile) const OVERRIDE; |
| 35 virtual bool ServiceRedirectedInIncognito() OVERRIDE; |
| 36 }; |
| 37 |
| 38 // ProfileKeyedServiceFactory for ExtensionSystem. |
| 39 class ExtensionSystemFactory : public ProfileKeyedServiceFactory { |
| 40 public: |
| 41 // ProfileKeyedServiceFactory implementation: |
| 42 static ExtensionSystem* GetForProfile(Profile* profile); |
| 43 |
| 44 static ExtensionSystemFactory* GetInstance(); |
| 45 |
| 46 virtual void ProfileShutdown(Profile* profile) OVERRIDE; |
| 47 |
| 48 private: |
| 49 friend struct DefaultSingletonTraits<ExtensionSystemFactory>; |
| 50 |
| 51 ExtensionSystemFactory(); |
| 52 virtual ~ExtensionSystemFactory(); |
| 53 |
| 54 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 55 Profile* profile) const OVERRIDE; |
| 56 virtual bool ServiceHasOwnInstanceInIncognito() OVERRIDE; |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_ |
OLD | NEW |