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

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: Merged with ToT 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
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_ui_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 58ec01c190d2dc9c710d9d99d964766bea3fedf0..86004d72db824d36baef2c2e19da8b22f315a93c 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -603,7 +603,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.
@@ -971,6 +972,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<ExtensionWarningSet::WarningType> warnings;
+ extension_warnings_.GetWarningsAffectingExtension(extension_id, &warnings);
+ extension_warnings_.ClearWarnings(warnings);
+
return true;
}
@@ -1071,6 +1078,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<ExtensionWarningSet::WarningType> warnings;
+ extension_warnings_.GetWarningsAffectingExtension(extension_id, &warnings);
+ extension_warnings_.ClearWarnings(warnings);
}
void ExtensionService::GrantPermissions(const Extension* extension) {
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698