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

Unified Diff: chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc

Issue 11547033: Implement declarativeContent API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 7 years, 11 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
Index: chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc b/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc
index 2cb62d30da64b4581cccaf6606ba9c5f89d382bf..ce9fb2c4e8d4a63d7cdafbefcdc0655e75169021 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc
@@ -194,7 +194,8 @@ void RulesRegistryStorageDelegate::Inner::InitForOTRProfile() {
const ExtensionSet* extensions = extension_service->extensions();
for (ExtensionSet::const_iterator i = extensions->begin();
i != extensions->end(); ++i) {
- if ((*i)->HasAPIPermission(APIPermission::kDeclarativeWebRequest) &&
+ if (((*i)->HasAPIPermission(APIPermission::kDeclarativeContent) ||
+ (*i)->HasAPIPermission(APIPermission::kDeclarativeWebRequest)) &&
extension_service->IsIncognitoEnabled((*i)->id()))
ReadFromStorage((*i)->id());
}
@@ -211,8 +212,8 @@ void RulesRegistryStorageDelegate::Inner::Observe(
content::Details<const extensions::Extension>(details).ptr();
// TODO(mpcomplete): This API check should generalize to any use of
// declarative rules, not just webRequest.
- if (extension->HasAPIPermission(
- APIPermission::kDeclarativeWebRequest)) {
+ if (extension->HasAPIPermission(APIPermission::kDeclarativeContent) ||
+ extension->HasAPIPermission(APIPermission::kDeclarativeWebRequest)) {
ExtensionInfoMap* extension_info_map =
ExtensionSystem::Get(profile_)->info_map();
if (profile_->IsOffTheRecord() &&

Powered by Google App Engine
This is Rietveld 408576698