| 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::Shared. | 
 |  18 // Should not be used except by ExtensionSystem(Factory). | 
 |  19 class ExtensionSystemSharedFactory : public ProfileKeyedServiceFactory { | 
 |  20  public: | 
 |  21   static ExtensionSystemImpl::Shared* GetForProfile(Profile* profile); | 
 |  22  | 
 |  23   static ExtensionSystemSharedFactory* GetInstance(); | 
 |  24  | 
 |  25  private: | 
 |  26   friend struct DefaultSingletonTraits<ExtensionSystemSharedFactory>; | 
 |  27  | 
 |  28   ExtensionSystemSharedFactory(); | 
 |  29   virtual ~ExtensionSystemSharedFactory(); | 
 |  30  | 
 |  31   virtual ProfileKeyedService* BuildServiceInstanceFor( | 
 |  32       Profile* profile) const OVERRIDE; | 
 |  33   virtual bool ServiceRedirectedInIncognito() OVERRIDE; | 
 |  34 }; | 
 |  35  | 
 |  36 // ProfileKeyedServiceFactory for ExtensionSystem. | 
 |  37 class ExtensionSystemFactory : public ProfileKeyedServiceFactory { | 
 |  38  public: | 
 |  39   // ProfileKeyedServiceFactory implementation: | 
 |  40   static ExtensionSystem* GetForProfile(Profile* profile); | 
 |  41  | 
 |  42   static ExtensionSystemFactory* GetInstance(); | 
 |  43  | 
 |  44  private: | 
 |  45   friend struct DefaultSingletonTraits<ExtensionSystemFactory>; | 
 |  46  | 
 |  47   ExtensionSystemFactory(); | 
 |  48   virtual ~ExtensionSystemFactory(); | 
 |  49  | 
 |  50   virtual ProfileKeyedService* BuildServiceInstanceFor( | 
 |  51       Profile* profile) const OVERRIDE; | 
 |  52   virtual bool ServiceHasOwnInstanceInIncognito() OVERRIDE; | 
 |  53   virtual bool ServiceIsCreatedWithProfile() OVERRIDE; | 
 |  54 }; | 
 |  55  | 
 |  56 #endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_ | 
| OLD | NEW |