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

Unified Diff: chrome/browser/extensions/tab_helper.cc

Issue 16087006: Revert "Revert 202751 "Change RulesRegistryService to use ProfileKeyedAPI."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « chrome/browser/extensions/tab_helper.h ('k') | chrome/browser/extensions/test_extension_system.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « chrome/browser/extensions/tab_helper.h ('k') | chrome/browser/extensions/test_extension_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698