| 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..60a03362c48ad8249ce482e702b7888558b95d86 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_before_unload_event|
|
| + // is true.
|
| + bool TryToCloseWindow(bool skip_before_unload_event,
|
| + 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_before_unload_event);
|
|
|
| // Whether we've completed firing all the tabs' beforeunload/unload events.
|
| bool HasCompletedUnloadProcessing() const;
|
| @@ -155,6 +158,10 @@ class UnloadController : public content::NotificationObserver,
|
| // are currently confirming that the browser is closable.
|
| base::Callback<void(bool)> on_close_confirmed_;
|
|
|
| + // Manage tabs with beforeunload/unload handlers when beforeunload events are
|
| + // bypassed.
|
| + std::unique_ptr<UnloadControllerWebContentsDelegate> web_contents_delegate_;
|
| +
|
| base::WeakPtrFactory<UnloadController> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(UnloadController);
|
|
|