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

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

Issue 341050: Implement loading blacklists from extensions.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: use real extension Created 11 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
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/extensions/user_script_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 1692e3f502e9bd9a40a4bed7e86d69b89e6e774d..dcca59e86bc4e36e5904a777c96e5291f202963d 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -333,7 +333,7 @@ void ExtensionsService::NotifyExtensionLoaded(Extension* extension) {
NotificationService::current()->Notify(
NotificationType::EXTENSION_LOADED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
}
@@ -342,7 +342,7 @@ void ExtensionsService::NotifyExtensionUnloaded(Extension* extension) {
NotificationService::current()->Notify(
NotificationType::EXTENSION_UNLOADED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
if (profile_ && !profile_->IsOffTheRecord()) {
@@ -417,7 +417,7 @@ void ExtensionsService::UnloadExtension(const std::string& extension_id) {
disabled_extensions_.erase(iter);
NotificationService::current()->Notify(
NotificationType::EXTENSION_UNLOADED_DISABLED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension.get()));
return;
}
@@ -463,7 +463,7 @@ void ExtensionsService::OnLoadedInstalledExtensions() {
}
NotificationService::current()->Notify(
NotificationType::EXTENSIONS_READY,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
NotificationService::NoDetails());
}
@@ -494,7 +494,7 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension,
extension_prefs_->SetExtensionState(extension, Extension::DISABLED);
NotificationService::current()->Notify(
NotificationType::EXTENSION_UPDATE_DISABLED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
}
} else {
@@ -528,7 +528,7 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension,
if (extension->IsTheme() && extension->location() == Extension::LOAD) {
NotificationService::current()->Notify(
NotificationType::THEME_INSTALLED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
} else {
ExtensionDOMUI::RegisterChromeURLOverrides(profile_,
@@ -538,7 +538,7 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension,
case Extension::DISABLED:
NotificationService::current()->Notify(
NotificationType::EXTENSION_UPDATE_DISABLED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
disabled_extensions_.push_back(scoped_extension.release());
break;
@@ -558,12 +558,12 @@ void ExtensionsService::OnExtensionInstalled(Extension* extension,
if (extension->IsTheme()) {
NotificationService::current()->Notify(
NotificationType::THEME_INSTALLED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
} else {
NotificationService::current()->Notify(
NotificationType::EXTENSION_INSTALLED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
}
@@ -576,12 +576,12 @@ void ExtensionsService::OnExtensionOverinstallAttempted(const std::string& id) {
if (extension && extension->IsTheme()) {
NotificationService::current()->Notify(
NotificationType::THEME_INSTALLED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<Extension>(extension));
} else {
NotificationService::current()->Notify(
NotificationType::NO_THEME_DETECTED,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
NotificationService::NoDetails());
}
}
@@ -666,7 +666,7 @@ void ExtensionsService::ReportExtensionLoadError(
bool be_noisy) {
NotificationService* service = NotificationService::current();
service->Notify(type,
- Source<ExtensionsService>(this),
+ Source<Profile>(profile_),
Details<const std::string>(&error));
// TODO(port): note that this isn't guaranteed to work properly on Linux.
@@ -676,6 +676,42 @@ void ExtensionsService::ReportExtensionLoadError(
ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy);
}
+std::vector<FilePath> ExtensionsService::GetPersistentBlacklistPaths() {
+ std::vector<FilePath> result;
+ for (ExtensionList::const_iterator extension_iter = extensions()->begin();
+ extension_iter != extensions()->end(); ++extension_iter) {
+ if ((*extension_iter)->location() == Extension::LOAD)
+ continue;
+
+ std::vector<Extension::PrivacyBlacklistInfo> blacklists(
+ (*extension_iter)->privacy_blacklists());
+ std::vector<Extension::PrivacyBlacklistInfo>::const_iterator blacklist_iter;
+ for (blacklist_iter = blacklists.begin();
+ blacklist_iter != blacklists.end(); ++blacklist_iter) {
+ result.push_back(blacklist_iter->path);
+ }
+ }
+ return result;
+}
+
+std::vector<FilePath> ExtensionsService::GetTransientBlacklistPaths() {
+ std::vector<FilePath> result;
+ for (ExtensionList::const_iterator extension_iter = extensions()->begin();
+ extension_iter != extensions()->end(); ++extension_iter) {
+ if ((*extension_iter)->location() != Extension::LOAD)
+ continue;
+
+ std::vector<Extension::PrivacyBlacklistInfo> blacklists(
+ (*extension_iter)->privacy_blacklists());
+ std::vector<Extension::PrivacyBlacklistInfo>::const_iterator blacklist_iter;
+ for (blacklist_iter = blacklists.begin();
+ blacklist_iter != blacklists.end(); ++blacklist_iter) {
+ result.push_back(blacklist_iter->path);
+ }
+ }
+ return result;
+}
+
// ExtensionsServicesBackend
ExtensionsServiceBackend::ExtensionsServiceBackend(
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/extensions/user_script_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698