| Index: chrome/browser/ui/unload_controller.cc
|
| diff --git a/chrome/browser/ui/unload_controller.cc b/chrome/browser/ui/unload_controller.cc
|
| index 289164e23836d899bfa7a93b1fdd76d9d27dabbb..55bc8544c9236d6ef20da9d9b4a9bede93420537 100644
|
| --- a/chrome/browser/ui/unload_controller.cc
|
| +++ b/chrome/browser/ui/unload_controller.cc
|
| @@ -18,6 +18,11 @@
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/web_contents.h"
|
|
|
| +#if defined (ENABLE_EXTENSIONS)
|
| +#include "extensions/browser/extension_registry.h"
|
| +#include "extensions/common/constants.h"
|
| +#endif // (ENABLE_EXTENSIONS)
|
| +
|
| namespace chrome {
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| @@ -51,6 +56,19 @@ bool UnloadController::ShouldRunUnloadEventsHelper(
|
| }
|
|
|
| bool UnloadController::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.
|
|
|