| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ | 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ |
| 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ | 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 ~RulesRegistryService() override; | 54 ~RulesRegistryService() override; |
| 55 | 55 |
| 56 // Unregisters refptrs to concrete RulesRegistries at other objects that were | 56 // Unregisters refptrs to concrete RulesRegistries at other objects that were |
| 57 // created by us so that the RulesRegistries can be released. | 57 // created by us so that the RulesRegistries can be released. |
| 58 void Shutdown() override; | 58 void Shutdown() override; |
| 59 | 59 |
| 60 // BrowserContextKeyedAPI implementation. | 60 // BrowserContextKeyedAPI implementation. |
| 61 static BrowserContextKeyedAPIFactory<RulesRegistryService>* | 61 static BrowserContextKeyedAPIFactory<RulesRegistryService>* |
| 62 GetFactoryInstance(); | 62 GetFactoryInstance(); |
| 63 | 63 |
| 64 // Convenience method to get the RulesRegistryService for a context. | 64 // Convenience method to get the RulesRegistryService for a context. If |
| 65 // |create| is provided, it specifies whether a new RulesRegistryService |
| 66 // should be created if one does not already exist (true if omitted). If |
| 67 // |create| is false and one does not already exist, nullptr will be returned. |
| 65 static RulesRegistryService* Get(content::BrowserContext* context); | 68 static RulesRegistryService* Get(content::BrowserContext* context); |
| 69 static RulesRegistryService* Get(content::BrowserContext* context, |
| 70 bool create); |
| 66 | 71 |
| 67 int GetNextRulesRegistryID(); | 72 int GetNextRulesRegistryID(); |
| 68 | 73 |
| 69 // Registers the default RulesRegistries used in Chromium. | 74 // Registers the default RulesRegistries used in Chromium. |
| 70 void EnsureDefaultRulesRegistriesRegistered(int rules_registry_id); | 75 void EnsureDefaultRulesRegistriesRegistered(int rules_registry_id); |
| 71 | 76 |
| 72 // Registers a RulesRegistry and wraps it in an InitializingRulesRegistry. | 77 // Registers a RulesRegistry and wraps it in an InitializingRulesRegistry. |
| 73 void RegisterRulesRegistry(scoped_refptr<RulesRegistry> rule_registry); | 78 void RegisterRulesRegistry(scoped_refptr<RulesRegistry> rule_registry); |
| 74 | 79 |
| 75 // Returns the RulesRegistry for |event_name| and |rules_registry_id| or | 80 // Returns the RulesRegistry for |event_name| and |rules_registry_id| or |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 extension_registry_observer_; | 144 extension_registry_observer_; |
| 140 | 145 |
| 141 content::BrowserContext* browser_context_; | 146 content::BrowserContext* browser_context_; |
| 142 | 147 |
| 143 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); | 148 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); |
| 144 }; | 149 }; |
| 145 | 150 |
| 146 } // namespace extensions | 151 } // namespace extensions |
| 147 | 152 |
| 148 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ | 153 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ |
| OLD | NEW |