Chromium Code Reviews| Index: chrome/browser/ui/unload_controller.cc |
| diff --git a/chrome/browser/ui/unload_controller.cc b/chrome/browser/ui/unload_controller.cc |
| index a30878d4f8401ef91a6bb32f0c9d2d675f9e32f5..af1ec1e1dc1f8bddc78fd062393dbd78f5560236 100644 |
| --- a/chrome/browser/ui/unload_controller.cc |
| +++ b/chrome/browser/ui/unload_controller.cc |
| @@ -17,6 +17,8 @@ |
| #include "content/public/browser/notification_types.h" |
| #include "content/public/browser/render_view_host.h" |
| #include "content/public/browser/web_contents.h" |
| +#include "extensions/browser/extension_registry.h" |
| +#include "extensions/common/constants.h" |
| namespace chrome { |
| @@ -51,6 +53,14 @@ bool UnloadController::ShouldRunUnloadEventsHelper( |
| } |
| bool UnloadController::RunUnloadEventsHelper(content::WebContents* contents) { |
| + GURL url = contents->GetLastCommittedURL(); |
|
Charlie Reis
2016/09/21 18:29:33
Same.
Devlin
2016/09/22 00:35:21
Done.
|
| + if (url.SchemeIs(extensions::kExtensionScheme) && |
| + !extensions::ExtensionRegistry::Get(browser_->profile()) |
| + ->enabled_extensions() |
| + .GetExtensionOrAppByURL(url)) { |
| + return false; |
| + } |
| + |
| // 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. |