Chromium Code Reviews| 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 f0577567cf6954b3b9301a5314ab721e5a3b683d..be5dae9059ea044edbd57fc22705c75bcefe20e6 100644 |
| --- a/chrome/browser/ui/fast_unload_controller.cc |
| +++ b/chrome/browser/ui/fast_unload_controller.cc |
| @@ -22,10 +22,11 @@ |
| #include "content/public/browser/render_view_host.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_delegate.h" |
| +#include "extensions/browser/extension_registry.h" |
| +#include "extensions/common/constants.h" |
| namespace chrome { |
| - |
| //////////////////////////////////////////////////////////////////////////////// |
| // DetachedWebContentsDelegate will delete web contents when they close. |
| class FastUnloadController::DetachedWebContentsDelegate |
| @@ -82,6 +83,14 @@ bool FastUnloadController::ShouldRunUnloadEventsHelper( |
| bool FastUnloadController::RunUnloadEventsHelper( |
| content::WebContents* contents) { |
| + GURL url = contents->GetLastCommittedURL(); |
|
Charlie Reis
2016/09/21 18:29:33
Let's add a comment, like: Don't run unload for ex
Devlin
2016/09/22 00:35:21
Done.
|
| + if (url.SchemeIs(extensions::kExtensionScheme) && |
| + !extensions::ExtensionRegistry::Get(browser_->profile()) |
|
Charlie Reis
2016/09/21 18:29:33
You would know better than I do, but does this nee
Devlin
2016/09/22 00:35:21
Probably should, yes. Added. An OWNER here can d
|
| + ->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. |