Chromium Code Reviews| Index: chrome/browser/ui/fast_unload_controller.h |
| diff --git a/chrome/browser/ui/fast_unload_controller.h b/chrome/browser/ui/fast_unload_controller.h |
| index 4022a60a6a62a633ba589784a9632bd0933ae33b..8500ef138a31dedd441b2644fadee13e1ad3ddd0 100644 |
| --- a/chrome/browser/ui/fast_unload_controller.h |
| +++ b/chrome/browser/ui/fast_unload_controller.h |
| @@ -18,6 +18,7 @@ |
| class Browser; |
| class TabStripModel; |
| +class UnloadControllerWebContentsDelegate; |
| namespace content { |
| class NotificationSource; |
| @@ -90,13 +91,14 @@ class FastUnloadController : 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| |
| + // 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 |
| @@ -141,7 +143,7 @@ class FastUnloadController : public content::NotificationObserver, |
| bool DetachWebContents(content::WebContents* contents); |
| // Processes the next tab that needs it's beforeunload/unload event fired. |
|
Charlie Reis
2017/02/27 21:47:51
Unrelated nit, while we're here: its (no apostroph
zmin
2017/03/06 23:58:08
Done.
|
| - void ProcessPendingTabs(); |
| + void ProcessPendingTabs(bool skip_before_unload_event); |
| // Cleans up state appropriately when we are trying to close the |
| // browser or close a tab in the background. We also use this in the |
| @@ -156,6 +158,8 @@ class FastUnloadController : public content::NotificationObserver, |
| void LogUnloadStep(const base::StringPiece& step_name, |
| content::WebContents* contents) const; |
| + void CancelTabNeedingBeforeUnloadAck(); |
| + |
| bool is_calling_before_unload_handlers() { |
| return !on_close_confirmed_.is_null(); |
| } |
| @@ -194,8 +198,7 @@ class FastUnloadController : public content::NotificationObserver, |
| base::Callback<void(bool)> on_close_confirmed_; |
| // Manage tabs with beforeunload/unload handlers that close detached. |
| - class DetachedWebContentsDelegate; |
| - std::unique_ptr<DetachedWebContentsDelegate> detached_delegate_; |
| + std::unique_ptr<UnloadControllerWebContentsDelegate> detached_delegate_; |
| base::WeakPtrFactory<FastUnloadController> weak_factory_; |