Index: chrome/browser/extensions/api/declarative/rules_registry_service.cc |
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service.cc b/chrome/browser/extensions/api/declarative/rules_registry_service.cc |
index aba57776a15ee3d2fead37e372c6a19d3f00291d..58d76b0934931d440daf014e95eb10a5f5b70a5e 100644 |
--- a/chrome/browser/extensions/api/declarative/rules_registry_service.cc |
+++ b/chrome/browser/extensions/api/declarative/rules_registry_service.cc |
@@ -14,6 +14,7 @@ |
#include "chrome/browser/extensions/api/declarative_webrequest/webrequest_constants.h" |
#include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h" |
#include "chrome/browser/extensions/api/web_request/web_request_api.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_details.h" |
#include "content/public/browser/notification_service.h" |
@@ -40,14 +41,16 @@ bool IsWebView(const RulesRegistryService::WebViewKey& webview_key) { |
} // namespace |
-RulesRegistryService::RulesRegistryService(Profile* profile) |
+RulesRegistryService::RulesRegistryService(content::BrowserContext* context) |
: content_rules_registry_(NULL), |
- profile_(profile) { |
- if (profile) { |
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
- content::Source<Profile>(profile->GetOriginalProfile())); |
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
- content::Source<Profile>(profile->GetOriginalProfile())); |
+ profile_(Profile::FromBrowserContext(context)) { |
+ if (profile_) { |
+ registrar_.Add(this, |
+ chrome::NOTIFICATION_EXTENSION_UNLOADED, |
+ content::Source<Profile>(profile_->GetOriginalProfile())); |
+ registrar_.Add(this, |
+ chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
+ content::Source<Profile>(profile_->GetOriginalProfile())); |
registrar_.Add(this, |
chrome::NOTIFICATION_EXTENSION_LOADED, |
content::Source<Profile>(profile_->GetOriginalProfile())); |
@@ -129,8 +132,9 @@ RulesRegistryService::GetFactoryInstance() { |
} |
// static |
-RulesRegistryService* RulesRegistryService::Get(Profile* profile) { |
- return ProfileKeyedAPIFactory<RulesRegistryService>::GetForProfile(profile); |
+RulesRegistryService* RulesRegistryService::Get( |
+ content::BrowserContext* context) { |
+ return ProfileKeyedAPIFactory<RulesRegistryService>::GetForProfile(context); |
} |
void RulesRegistryService::RegisterRulesRegistry( |