Index: chrome/browser/extensions/tab_helper.cc |
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc |
index 1bd1011de4dcacdefeaf91e86826238d2fa51267..09c4a74f04ee464b2f5278942c05bd077608b2ca 100644 |
--- a/chrome/browser/extensions/tab_helper.cc |
+++ b/chrome/browser/extensions/tab_helper.cc |
@@ -85,10 +85,6 @@ TabHelper::TabHelper(content::WebContents* web_contents) |
pending_web_app_action_(NONE), |
script_executor_(new ScriptExecutor(web_contents, |
&script_execution_observers_)), |
- rules_registry_service_( |
- ExtensionSystem::Get( |
- Profile::FromBrowserContext(web_contents->GetBrowserContext()))-> |
- rules_registry_service()), |
image_loader_ptr_factory_(this) { |
// The ActiveTabPermissionManager requires a session ID; ensure this |
// WebContents has one. |
@@ -194,9 +190,9 @@ void TabHelper::DidNavigateMainFrame( |
const content::LoadCommittedDetails& details, |
const content::FrameNavigateParams& params) { |
#if defined(ENABLE_EXTENSIONS) |
- if (rules_registry_service_) { |
- rules_registry_service_->content_rules_registry()->DidNavigateMainFrame( |
- web_contents(), details, params); |
+ if (ExtensionSystem::Get(profile_)->extension_service()) { |
+ RulesRegistryService::Get(profile_)->content_rules_registry()-> |
+ DidNavigateMainFrame(web_contents(), details, params); |
} |
#endif // defined(ENABLE_EXTENSIONS) |
@@ -345,8 +341,8 @@ void TabHelper::OnContentScriptsExecuting( |
void TabHelper::OnWatchedPageChange( |
const std::vector<std::string>& css_selectors) { |
#if defined(ENABLE_EXTENSIONS) |
- if (rules_registry_service_) { |
- rules_registry_service_->content_rules_registry()->Apply( |
+ if (ExtensionSystem::Get(profile_)->extension_service()) { |
+ RulesRegistryService::Get(profile_)->content_rules_registry()->Apply( |
web_contents(), css_selectors); |
} |
#endif // defined(ENABLE_EXTENSIONS) |