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

Unified Diff: chrome/browser/ui/unload_controller.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.h
diff --git a/chrome/browser/ui/unload_controller.h b/chrome/browser/ui/unload_controller.h
index e8f22e862c43370856531805457957e653d5681b..d47388b5815f1e863fb72fd6185346b4c9b837da 100644
--- a/chrome/browser/ui/unload_controller.h
+++ b/chrome/browser/ui/unload_controller.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_UNLOAD_CONTROLLER_H_
#define CHROME_BROWSER_UI_UNLOAD_CONTROLLER_H_
+#include <memory>
#include <set>
#include "base/callback.h"
@@ -16,6 +17,7 @@
class Browser;
class TabStripModel;
+class UnloadControllerWebContentsDelegate;
namespace content {
class NotificationSource;
@@ -62,13 +64,14 @@ class UnloadController : public content::NotificationObserver,
bool ShouldCloseWindow();
// Begins the process of confirming whether the associated browser can be
- // closed.
- bool CallBeforeUnloadHandlers(
- const base::Callback<void(bool)>& on_close_confirmed);
+ // closed. Beforeunload events won't be fired if |skip_beforeunload|
+ // is true.
+ bool TryToCloseWindow(bool skip_beforeunload,
+ const base::Callback<void(bool)>& on_close_confirmed);
// Clears the results of any beforeunload confirmation dialogs triggered by a
- // CallBeforeUnloadHandlers call.
- void ResetBeforeUnloadHandlers();
+ // TryToCloseWindow call.
+ void ResetTryToCloseWindow();
// Returns true if |browser_| has any tabs that have BeforeUnload handlers
// that have not been fired. This method is non-const because it builds a list
@@ -107,7 +110,7 @@ class UnloadController : public content::NotificationObserver,
void TabDetachedImpl(content::WebContents* contents);
// Processes the next tab that needs it's beforeunload/unload event fired.
- void ProcessPendingTabs();
+ void ProcessPendingTabs(bool skip_beforeunload);
// Whether we've completed firing all the tabs' beforeunload/unload events.
bool HasCompletedUnloadProcessing() const;

Powered by Google App Engine
This is Rietveld 408576698