Index: chrome/browser/ui/unload_controller_web_contents_delegate.h |
diff --git a/chrome/browser/ui/unload_controller_web_contents_delegate.h b/chrome/browser/ui/unload_controller_web_contents_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e5ec73ecca38ed1afed1a6d355d26a97ce5ab047 |
--- /dev/null |
+++ b/chrome/browser/ui/unload_controller_web_contents_delegate.h |
@@ -0,0 +1,28 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_UNLOAD_CONTROLLER_WEB_CONTENTS_DELEGATE_H_ |
+#define CHROME_BROWSER_UI_UNLOAD_CONTROLLER_WEB_CONTENTS_DELEGATE_H_ |
+ |
+#include "content/public/browser/web_contents_delegate.h" |
+ |
+// UnloadControllerWebContentsDelegate will delete web contents when they are |
+// closed. It's used by UnloadController when beforeunload event is skipped so |
+// that the existed dialogs will be closed as well. It's used by |
sky
2017/03/14 00:04:05
exited -> existing
zmin
2017/03/14 17:46:47
Done.
|
+// FastUnloadController regardless. |
+class UnloadControllerWebContentsDelegate |
+ : public content::WebContentsDelegate { |
+ public: |
+ UnloadControllerWebContentsDelegate(); |
+ ~UnloadControllerWebContentsDelegate() override; |
+ |
+ // WebContentsDelegate implementation. |
+ bool ShouldSuppressDialogs(content::WebContents* source) override; |
+ void CloseContents(content::WebContents* source) override; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(UnloadControllerWebContentsDelegate); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_UNLOAD_CONTROLLER_WEB_CONTENTS_DELEGATE_H_ |