Index: chrome/browser/extensions/api/declarative/rules_registry_service.h |
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service.h b/chrome/browser/extensions/api/declarative/rules_registry_service.h |
index 1910d1650b41ccc90603ce133636c4c5f6cfcdb8..7d74bd1261ba7227146c26fbd738deef9de6fcfb 100644 |
--- a/chrome/browser/extensions/api/declarative/rules_registry_service.h |
+++ b/chrome/browser/extensions/api/declarative/rules_registry_service.h |
@@ -10,6 +10,7 @@ |
#include <vector> |
#include "base/memory/ref_counted.h" |
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
@@ -30,7 +31,8 @@ namespace extensions { |
// This class owns all RulesRegistries implementations of an ExtensionService. |
// This class lives on the UI thread. |
-class RulesRegistryService : public content::NotificationObserver { |
+class RulesRegistryService : public ProfileKeyedAPI, |
+ public content::NotificationObserver { |
public: |
explicit RulesRegistryService(Profile* profile); |
virtual ~RulesRegistryService(); |
@@ -39,6 +41,9 @@ class RulesRegistryService : public content::NotificationObserver { |
// created by us so that the RulesRegistries can be released. |
void Shutdown(); |
+ // ProfileKeyedAPI implementation. |
+ static ProfileKeyedAPIFactory<RulesRegistryService>* GetFactoryInstance(); |
+ |
// Registers the default RulesRegistries used in Chromium. |
void RegisterDefaultRulesRegistries(); |
@@ -59,6 +64,8 @@ class RulesRegistryService : public content::NotificationObserver { |
// For testing. |
void SimulateExtensionUnloaded(const std::string& extension_id); |
private: |
+ friend class ProfileKeyedAPIFactory<RulesRegistryService>; |
+ |
// Maps event names to RuleRegistries that handle these events. |
typedef std::map<std::string, scoped_refptr<RulesRegistry> > RulesRegistryMap; |
@@ -72,6 +79,11 @@ class RulesRegistryService : public content::NotificationObserver { |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
+ // ProfileKeyedAPI implementation. |
+ static const char* service_name() { |
+ return "RulesRegistryService"; |
+ } |
+ |
RulesRegistryMap rule_registries_; |
// These are weak pointers to the delegates owned by the RulesRegistry's. We |