Changes to closing contents with beforeunload/unload handlers:
- Closing a single tab, run beforeunload (if needed), then detached the tab from
tab strip and close it asynchronously (no ui).
- Closing a window, run all beforeunload handlers (same as before), then detach all tabs with unload handlers. Close any remaining tabs and hide the browser window while waiting for the unload handlers to complete.
This CL started with fast-tab-closure and has grown to include fast-window-closure too.
BUG=142458,156896
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195108
[email protected], [email protected]
Review URL: https://codereview.chromium.org/11016023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203922 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index af5148e..a533ea1 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -267,6 +267,9 @@
virtual base::TimeTicks GetNewTabStartTime() const OVERRIDE;
virtual void Close() OVERRIDE;
virtual void OnCloseStarted() OVERRIDE;
+ virtual void OnCloseCanceled() OVERRIDE;
+ virtual void OnUnloadStarted() OVERRIDE;
+ virtual void OnUnloadDetachedStarted() OVERRIDE;
virtual void SystemDragEnded() OVERRIDE;
virtual void UserGestureDone() OVERRIDE;
virtual void SetClosedByUserGesture(bool value) OVERRIDE;
@@ -874,6 +877,9 @@
// The time when onbeforeunload ended.
base::TimeTicks before_unload_end_time_;
+ // The time when the tab was removed from view during close.
+ base::TimeTicks unload_detached_start_time_;
+
// The time that this tab was last selected.
base::TimeTicks last_selected_time_;