| Index: chrome/browser/ui/fast_unload_controller.cc
|
| diff --git a/chrome/browser/ui/fast_unload_controller.cc b/chrome/browser/ui/fast_unload_controller.cc
|
| index 503c137f4d86af2130e728574037f5485ebb5c6b..d516d89b2ba720d77c33df7c92926f735ab6b5fd 100644
|
| --- a/chrome/browser/ui/fast_unload_controller.cc
|
| +++ b/chrome/browser/ui/fast_unload_controller.cc
|
| @@ -23,8 +23,12 @@
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/browser/web_contents_delegate.h"
|
|
|
| -namespace chrome {
|
| +#if defined (ENABLE_EXTENSIONS)
|
| +#include "extensions/browser/extension_registry.h"
|
| +#include "extensions/common/constants.h"
|
| +#endif // (ENABLE_EXTENSIONS)
|
|
|
| +namespace chrome {
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // DetachedWebContentsDelegate will delete web contents when they close.
|
| @@ -82,6 +86,19 @@ bool FastUnloadController::ShouldRunUnloadEventsHelper(
|
|
|
| bool FastUnloadController::RunUnloadEventsHelper(
|
| content::WebContents* contents) {
|
| +#if defined (ENABLE_EXTENSIONS)
|
| + // Don't run for extensions that are disabled or uninstalled; the tabs will
|
| + // be killed if they make any network requests, and the extension shouldn't
|
| + // be doing any work if it's removed.
|
| + GURL url = contents->GetLastCommittedURL();
|
| + if (url.SchemeIs(extensions::kExtensionScheme) &&
|
| + !extensions::ExtensionRegistry::Get(browser_->profile())
|
| + ->enabled_extensions()
|
| + .GetExtensionOrAppByURL(url)) {
|
| + return false;
|
| + }
|
| +#endif // (ENABLE_EXTENSIONS)
|
| +
|
| // Special case for when we quit an application. The Devtools window can
|
| // close if it's beforeunload event has already fired which will happen due
|
| // to the interception of it's content's beforeunload.
|
|
|