Index: chrome/browser/extensions/tab_helper.cc |
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc |
index bc51f17378051425d25055f3f041185f4fbee937..72168bc135c333aef324aef7c419ed9a58f2b353 100644 |
--- a/chrome/browser/extensions/tab_helper.cc |
+++ b/chrome/browser/extensions/tab_helper.cc |
@@ -250,8 +250,15 @@ void TabHelper::DidNavigateMainFrame( |
#if defined(ENABLE_EXTENSIONS) |
if (ExtensionSystem::Get(profile_)->extension_service() && |
RulesRegistryService::Get(profile_)) { |
- RulesRegistryService::Get(profile_)->content_rules_registry()-> |
- DidNavigateMainFrame(web_contents(), details, params); |
+ ContentRulesRegistryMap& content_rules_registry_map = |
+ RulesRegistryService::Get(profile_)->content_rules_registry_map(); |
+ for (ContentRulesRegistryMap::iterator it = |
+ content_rules_registry_map.begin(); |
+ it != content_rules_registry_map.end(); ++it) { |
+ it->second->DidNavigateMainFrame(web_contents(), |
+ details, |
+ params); |
+ } |
} |
#endif // defined(ENABLE_EXTENSIONS) |
@@ -461,12 +468,18 @@ void TabHelper::OnContentScriptsExecuting( |
} |
void TabHelper::OnWatchedPageChange( |
+ const std::string& event_name, |
const std::vector<std::string>& css_selectors) { |
#if defined(ENABLE_EXTENSIONS) |
if (ExtensionSystem::Get(profile_)->extension_service() && |
RulesRegistryService::Get(profile_)) { |
- RulesRegistryService::Get(profile_)->content_rules_registry()->Apply( |
- web_contents(), css_selectors); |
+ ContentRulesRegistry* content_rules_registry = |
+ RulesRegistryService::Get(profile_)-> |
+ GetContentRulesRegistry(event_name); |
+ if (!content_rules_registry) |
+ return; |
+ |
+ content_rules_registry->Apply(web_contents(), css_selectors); |
} |
#endif // defined(ENABLE_EXTENSIONS) |
} |