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

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

Issue 52743002: Declarative rules should be removed on uninstalling, not unloading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further comments addressed Created 7 years, 1 month 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_cache_delegate.cc
diff --git a/chrome/browser/extensions/api/declarative/rules_cache_delegate.cc b/chrome/browser/extensions/api/declarative/rules_cache_delegate.cc
index d2a45fb8e29d0fee13c1db42b6d6b4bb3a817b67..44e5d57bb307ae451705e503e0814d03653f8354 100644
--- a/chrome/browser/extensions/api/declarative/rules_cache_delegate.cc
+++ b/chrome/browser/extensions/api/declarative/rules_cache_delegate.cc
@@ -79,10 +79,6 @@ void RulesCacheDelegate::Init(RulesRegistry* registry) {
if (store)
store->RegisterKey(storage_key_);
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_LOADED,
- content::Source<Profile>(profile_->GetOriginalProfile()));
-
if (profile_->IsOffTheRecord())
log_storage_init_delay_ = false;
@@ -114,29 +110,6 @@ void RulesCacheDelegate::WriteToStorage(const std::string& extension_id,
store->SetExtensionValue(extension_id, storage_key_, value.Pass());
}
-void RulesCacheDelegate::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_LOADED, type);
-
- const extensions::Extension* extension =
- 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::kDeclarativeContent) ||
- extension->HasAPIPermission(APIPermission::kDeclarativeWebRequest)) {
- InfoMap* extension_info_map = ExtensionSystem::Get(profile_)->info_map();
- if (profile_->IsOffTheRecord() &&
- !extension_info_map->IsIncognitoEnabled(extension->id())) {
- // Ignore this extension.
- } else {
- ReadFromStorage(extension->id());
- }
- }
-}
-
void RulesCacheDelegate::CheckIfReady() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (notified_registry_ || !waiting_for_extensions_.empty())

Powered by Google App Engine
This is Rietveld 408576698