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

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

Issue 342003005: Show alert failure for reloading unpacked extensions with bad manifest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prettified failure path Created 6 years, 5 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 f17b67b981e42548028cce69dd871dd9fdc1b444..d1015275537f96b8555a9dd8233048e544e4ad6a 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -596,10 +596,11 @@ bool ExtensionService::UpdateExtension(const std::string& id,
#endif
}
-void ExtensionService::ReloadExtension(
+void ExtensionService::ReloadExtensionImpl(
// "transient" because the process of reloading may cause the reference
// to become invalid. Instead, use |extension_id|, a copy.
- const std::string& transient_extension_id) {
+ const std::string& transient_extension_id,
+ bool be_noisy) {
#if defined(ENABLE_EXTENSIONS)
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -683,13 +684,25 @@ void ExtensionService::ReloadExtension(
// We should always be able to remember the extension's path. If it's not in
// the map, someone failed to update |unloaded_extension_paths_|.
CHECK(!path.empty());
- extensions::UnpackedInstaller::Create(this)->Load(path);
+ scoped_refptr<extensions::UnpackedInstaller> unpacked_installer =
+ extensions::UnpackedInstaller::Create(this);
+ unpacked_installer->set_be_noisy_on_failure(be_noisy);
+ unpacked_installer->Load(path);
}
// When reloading is done, mark this extension as done reloading.
SetBeingReloaded(extension_id, false);
#endif // defined(ENABLE_EXTENSIONS)
}
+void ExtensionService::ReloadExtension(const std::string& extension_id) {
+ ReloadExtensionImpl(extension_id, true /* be_noisy */);
+}
+
+void ExtensionService::ReloadExtensionWithQuietFailure(
+ const std::string& extension_id) {
+ ReloadExtensionImpl(extension_id, false /* be_noisy */);
Finnur 2014/07/14 10:25:58 Nit: No multi-line comments, use // (after the sem
gpdavis 2014/07/14 18:58:19 No problem. Devlin originally suggested I do it t
Finnur 2014/07/15 10:38:44 Documenting params like this is often helpful, and
gpdavis 2014/07/15 18:33:14 Understood. I'll stick with single line comments
+}
+
bool ExtensionService::UninstallExtension(
// "transient" because the process of uninstalling may cause the reference
// to become invalid. Instead, use |extenson->id()|.

Powered by Google App Engine
This is Rietveld 408576698