| 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_API_DECLARATIVE_RULES_REGISTRY_SERVICE_FACTORY
_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_FACTORY
_H__ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/memory/singleton.h" |
| 11 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 12 |
| 13 namespace extensions { |
| 14 |
| 15 class RulesRegistryService; |
| 16 |
| 17 // Singleton that owns all RulesRegistryService and associates them with |
| 18 // Profiles. Listens for the Profile's destruction notification and cleans up |
| 19 // the associated RulesRegistryServic. |
| 20 class RulesRegistryServiceFactory : public ProfileKeyedServiceFactory { |
| 21 public: |
| 22 // Returns the RulesRegistryService that owns RuleRegistries resources for |
| 23 // |profile|. |
| 24 static RulesRegistryService* GetForProfile(Profile* profile); |
| 25 |
| 26 static RulesRegistryServiceFactory* GetInstance(); |
| 27 |
| 28 private: |
| 29 friend struct DefaultSingletonTraits<RulesRegistryServiceFactory>; |
| 30 |
| 31 RulesRegistryServiceFactory(); |
| 32 virtual ~RulesRegistryServiceFactory(); |
| 33 |
| 34 // ProfileKeyedServiceFactory: |
| 35 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 36 Profile* profile) const OVERRIDE; |
| 37 virtual bool ServiceRedirectedInIncognito() OVERRIDE; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(RulesRegistryServiceFactory); |
| 40 }; |
| 41 |
| 42 } |
| 43 |
| 44 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_FACT
ORY_H__ |
| OLD | NEW |