| 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 aead2a977fc688213a2a0fee607abecc26e9dd93..24e7f3259200d11c542f30032d5c724149255236 100644
|
| --- a/chrome/browser/extensions/api/declarative/rules_registry_service.cc
|
| +++ b/chrome/browser/extensions/api/declarative/rules_registry_service.cc
|
| @@ -22,15 +22,20 @@ namespace extensions {
|
| namespace {
|
|
|
| // Returns the key to use for storing declarative rules in the state store.
|
| -std::string GetDeclarativeRuleStorageKey(const std::string& event_name) {
|
| - return "declarative_rules." + event_name;
|
| +std::string GetDeclarativeRuleStorageKey(const std::string& event_name,
|
| + bool incognito) {
|
| + if (incognito)
|
| + return "declarative_rules.incognito." + event_name;
|
| + else
|
| + return "declarative_rules." + event_name;
|
| }
|
|
|
| // Registers |web_request_rules_registry| on the IO thread.
|
| void RegisterToExtensionWebRequestEventRouterOnIO(
|
| + void* profile,
|
| scoped_refptr<WebRequestRulesRegistry> web_request_rules_registry) {
|
| ExtensionWebRequestEventRouter::GetInstance()->RegisterRulesRegistry(
|
| - web_request_rules_registry);
|
| + profile, web_request_rules_registry);
|
| }
|
|
|
| } // namespace
|
| @@ -39,7 +44,7 @@ RulesRegistryService::RulesRegistryService(Profile* profile)
|
| : profile_(profile) {
|
| if (profile) {
|
| registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
|
| - content::Source<Profile>(profile));
|
| + content::Source<Profile>(profile->GetOriginalProfile()));
|
| }
|
| }
|
|
|
| @@ -54,7 +59,8 @@ void RulesRegistryService::RegisterDefaultRulesRegistries() {
|
| new WebRequestRulesRegistry(profile_, delegate));
|
| delegate->InitOnUIThread(profile_, web_request_rules_registry,
|
| GetDeclarativeRuleStorageKey(
|
| - declarative_webrequest_constants::kOnRequest));
|
| + declarative_webrequest_constants::kOnRequest,
|
| + profile_->IsOffTheRecord()));
|
| delegates_.push_back(delegate);
|
|
|
| RegisterRulesRegistry(declarative_webrequest_constants::kOnRequest,
|
| @@ -62,14 +68,14 @@ void RulesRegistryService::RegisterDefaultRulesRegistries() {
|
| content::BrowserThread::PostTask(
|
| content::BrowserThread::IO, FROM_HERE,
|
| base::Bind(&RegisterToExtensionWebRequestEventRouterOnIO,
|
| - web_request_rules_registry));
|
| + profile_, web_request_rules_registry));
|
| }
|
|
|
| void RulesRegistryService::Shutdown() {
|
| content::BrowserThread::PostTask(
|
| content::BrowserThread::IO, FROM_HERE,
|
| base::Bind(&RegisterToExtensionWebRequestEventRouterOnIO,
|
| - scoped_refptr<WebRequestRulesRegistry>(NULL)));
|
| + profile_, scoped_refptr<WebRequestRulesRegistry>(NULL)));
|
| }
|
|
|
| void RulesRegistryService::RegisterRulesRegistry(
|
|
|