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

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

Issue 8176001: Warn user in case extension delays network traffic too much. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleanup Created 9 years, 2 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/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 1754e6c9552253ece72380cc3c55fcc974c33623..bbcf6a4caa56699f8fb9218dbd0e215fa512a01a 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -598,7 +598,8 @@ ExtensionService::ExtensionService(Profile* profile,
app_notification_manager_(new AppNotificationManager(profile)),
permissions_manager_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
apps_promo_(profile->GetPrefs()),
- event_routers_initialized_(false) {
+ event_routers_initialized_(false),
+ extension_warnings_(profile) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Figure out if extension installation should be enabled.
@@ -968,6 +969,12 @@ bool ExtensionService::UninstallExtension(
UserMetrics::RecordAction(
UserMetricsAction("Extensions.ExtensionUninstalled"));
+ // Uninstalling one extension might have solved the problems of others.
+ // Therefore, we clear warnings of this type for all extensions.
+ std::set<ExtensionWarning::WarningType> warnings;
+ extension_warnings_.GetWarningsAffectingExtension(extension_id, &warnings);
+ extension_warnings_.ClearWarnings(warnings);
+
return true;
}
@@ -1068,6 +1075,12 @@ void ExtensionService::DisableExtension(const std::string& extension_id) {
NotifyExtensionUnloaded(extension, extension_misc::UNLOAD_REASON_DISABLE);
SyncExtensionChangeIfNeeded(*extension);
+
+ // Deactivating one extension might have solved the problems of others.
+ // Therefore, we clear warnings of this type for all extensions.
+ std::set<ExtensionWarning::WarningType> warnings;
+ extension_warnings_.GetWarningsAffectingExtension(extension_id, &warnings);
+ extension_warnings_.ClearWarnings(warnings);
}
void ExtensionService::GrantPermissions(const Extension* extension) {

Powered by Google App Engine
This is Rietveld 408576698