| Index: chrome/browser/extensions/tab_helper.cc
|
| diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
|
| index 4889d417a98dc43615753b7cb798694361462635..22d84fc97cc1ee2bdc2f1428446b716f5aa71997 100644
|
| --- a/chrome/browser/extensions/tab_helper.cc
|
| +++ b/chrome/browser/extensions/tab_helper.cc
|
| @@ -240,10 +240,18 @@ void TabHelper::RenderViewCreated(RenderViewHost* render_view_host) {
|
| void TabHelper::DidNavigateMainFrame(
|
| const content::LoadCommittedDetails& details,
|
| const content::FrameNavigateParams& params) {
|
| + typedef std::map<std::string, ContentRulesRegistry*> ContentRulesRegistryMap;
|
| 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);
|
| + }
|
| }
|
|
|
| content::BrowserContext* context = web_contents()->GetBrowserContext();
|
| @@ -444,11 +452,17 @@ void TabHelper::OnContentScriptsExecuting(
|
| }
|
|
|
| void TabHelper::OnWatchedPageChange(
|
| + const std::string& event_name,
|
| const std::vector<std::string>& css_selectors) {
|
| 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);
|
| }
|
| }
|
|
|
|
|