| 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 <tuple> | 10 #include <tuple> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Maps <event name, rules registry ID> to RuleRegistries that handle these | 100 // Maps <event name, rules registry ID> to RuleRegistries that handle these |
| 101 // events. | 101 // events. |
| 102 typedef std::map<RulesRegistryKey, scoped_refptr<RulesRegistry> > | 102 typedef std::map<RulesRegistryKey, scoped_refptr<RulesRegistry> > |
| 103 RulesRegistryMap; | 103 RulesRegistryMap; |
| 104 | 104 |
| 105 // ExtensionRegistryObserver implementation. | 105 // ExtensionRegistryObserver implementation. |
| 106 void OnExtensionLoaded(content::BrowserContext* browser_context, | 106 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 107 const Extension* extension) override; | 107 const Extension* extension) override; |
| 108 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 108 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 109 const Extension* extension, | 109 const Extension* extension, |
| 110 UnloadedExtensionInfo::Reason reason) override; | 110 UnloadedExtensionReason reason) override; |
| 111 void OnExtensionUninstalled(content::BrowserContext* browser_context, | 111 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
| 112 const Extension* extension, | 112 const Extension* extension, |
| 113 extensions::UninstallReason reason) override; | 113 extensions::UninstallReason reason) override; |
| 114 | 114 |
| 115 // Iterates over all registries, and calls |notification_callback| on them | 115 // Iterates over all registries, and calls |notification_callback| on them |
| 116 // with |extension| as the argument. If a registry lives on a different | 116 // with |extension| as the argument. If a registry lives on a different |
| 117 // thread, the call is posted to that thread, so no guarantee of synchronous | 117 // thread, the call is posted to that thread, so no guarantee of synchronous |
| 118 // processing. | 118 // processing. |
| 119 void NotifyRegistriesHelper( | 119 void NotifyRegistriesHelper( |
| 120 void (RulesRegistry::*notification_callback)(const Extension*), | 120 void (RulesRegistry::*notification_callback)(const Extension*), |
| (...skipping 22 matching lines...) Expand all Loading... |
| 143 extension_registry_observer_; | 143 extension_registry_observer_; |
| 144 | 144 |
| 145 content::BrowserContext* browser_context_; | 145 content::BrowserContext* browser_context_; |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); | 147 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 } // namespace extensions | 150 } // namespace extensions |
| 151 | 151 |
| 152 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ | 152 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ |
| OLD | NEW |