Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: chrome/browser/ui/unload_controller_web_contents_delegate.h

Issue 2681203002: Add Browser::SkipCallBeforeUnload so that the browser windows can be closed regardless of beforeunl… (Closed)
Patch Set: cr - remove delegate in UnloadController Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..684c77f1392692b24fdcaaec4d704f7458167e9e
--- /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 existing dialogs will be closed as well. It's used by
+// 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_
« no previous file with comments | « chrome/browser/ui/unload_controller.cc ('k') | chrome/browser/ui/unload_controller_web_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698