Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: extensions/browser/api/declarative/rules_registry_service.cc

Issue 1158693006: Create a mechanism define declarative rules via the extension manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a manifest handler Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/declarative/rules_registry_service.cc
diff --git a/extensions/browser/api/declarative/rules_registry_service.cc b/extensions/browser/api/declarative/rules_registry_service.cc
index a1e02d840c8d77a2c4fd239a78adb17b188bbb06..b988e6ccd1e6fc24ad239fd87b5ad1f3dd23c378 100644
--- a/extensions/browser/api/declarative/rules_registry_service.cc
+++ b/extensions/browser/api/declarative/rules_registry_service.cc
@@ -169,23 +169,22 @@ void RulesRegistryService::RemoveRulesRegistriesByID(int rules_registry_id) {
}
void RulesRegistryService::SimulateExtensionUninstalled(
- const std::string& extension_id) {
- NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled, extension_id);
+ const Extension* extension) {
+ NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled, extension);
}
void RulesRegistryService::NotifyRegistriesHelper(
- void (RulesRegistry::*notification_callback)(const std::string&),
- const std::string& extension_id) {
+ void (RulesRegistry::*notification_callback)(const Extension*),
+ const Extension* extension) {
RulesRegistryMap::iterator i;
for (i = rule_registries_.begin(); i != rule_registries_.end(); ++i) {
scoped_refptr<RulesRegistry> registry = i->second;
if (content::BrowserThread::CurrentlyOn(registry->owner_thread())) {
- (registry.get()->*notification_callback)(extension_id);
+ (registry.get()->*notification_callback)(extension);
} else {
content::BrowserThread::PostTask(
- registry->owner_thread(),
- FROM_HERE,
- base::Bind(notification_callback, registry, extension_id));
+ registry->owner_thread(), FROM_HERE,
+ base::Bind(notification_callback, registry, extension));
}
}
}
@@ -193,22 +192,21 @@ void RulesRegistryService::NotifyRegistriesHelper(
void RulesRegistryService::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) {
- NotifyRegistriesHelper(&RulesRegistry::OnExtensionLoaded, extension->id());
+ NotifyRegistriesHelper(&RulesRegistry::OnExtensionLoaded, extension);
}
void RulesRegistryService::OnExtensionUnloaded(
content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionInfo::Reason reason) {
- NotifyRegistriesHelper(&RulesRegistry::OnExtensionUnloaded, extension->id());
+ NotifyRegistriesHelper(&RulesRegistry::OnExtensionUnloaded, extension);
}
void RulesRegistryService::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const Extension* extension,
extensions::UninstallReason reason) {
- NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled,
- extension->id());
+ NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled, extension);
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698