summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/extensions/extensions_service.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 3134000..0e723b6 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -702,9 +702,14 @@ void ExtensionsService::SetIsIncognitoEnabled(Extension* extension,
bool enabled) {
extension_prefs_->SetIsIncognitoEnabled(extension->id(), enabled);
- // Broadcast unloaded and loaded events to update browser state.
- NotifyExtensionUnloaded(extension);
- NotifyExtensionLoaded(extension);
+ // Broadcast unloaded and loaded events to update browser state. Only bother
+ // if the extension is actually enabled, since there is no UI otherwise.
+ bool is_enabled = std::find(extensions_.begin(), extensions_.end(),
+ extension) != extensions_.end();
+ if (is_enabled) {
+ NotifyExtensionUnloaded(extension);
+ NotifyExtensionLoaded(extension);
+ }
}
bool ExtensionsService::AllowFileAccess(const Extension* extension) {