Index: chrome/browser/extensions/extension_service.cc |
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
index 74b3b2d5387119b14665da4ab99e16c3c0b5ae75..2bc318fdc273b05d1f3ab60686a8903f421fc406 100644 |
--- a/chrome/browser/extensions/extension_service.cc |
+++ b/chrome/browser/extensions/extension_service.cc |
@@ -1734,7 +1734,7 @@ void ExtensionService::HandleExtensionAlertAccept( |
global_error.get_external_extension_ids(); |
for (ExtensionIdSet::const_iterator iter = extension_ids->begin(); |
iter != extension_ids->end(); ++iter) { |
- extension_prefs_->AcknowledgeExternalExtension(*iter); |
+ AcknowledgeExternalExtension(*iter); |
} |
extension_ids = global_error.get_blacklisted_extension_ids(); |
for (ExtensionIdSet::const_iterator iter = extension_ids->begin(); |
@@ -1748,6 +1748,10 @@ void ExtensionService::HandleExtensionAlertAccept( |
} |
} |
+void ExtensionService::AcknowledgeExternalExtension(const std::string& id) { |
+ extension_prefs_->AcknowledgeExternalExtension(id); |
+} |
+ |
void ExtensionService::HandleExtensionAlertDetails( |
const ExtensionGlobalError& global_error, Browser* browser) { |
if (browser) { |
@@ -2240,7 +2244,8 @@ void ExtensionService::OnExternalExtensionFileFound( |
const Version* version, |
const FilePath& path, |
Extension::Location location, |
- int creation_flags) { |
+ int creation_flags, |
+ bool mark_acknowledged) { |
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
CHECK(Extension::IdIsValid(id)); |
if (extension_prefs_->IsExternalExtensionUninstalled(id)) |
@@ -2277,6 +2282,12 @@ void ExtensionService::OnExternalExtensionFileFound( |
installer->set_install_cause(extension_misc::INSTALL_CAUSE_EXTERNAL_FILE); |
installer->set_creation_flags(creation_flags); |
installer->InstallCrx(path); |
+ |
+ // Depending on the source, a new external extension might not need a user |
+ // notification on installation. For such extensions, mark them acknowledged |
+ // now to suppress the notification. |
+ if (mark_acknowledged) |
+ AcknowledgeExternalExtension(id); |
} |
void ExtensionService::ReportExtensionLoadError( |