diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-02 00:44:47 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-02 00:44:47 +0000 |
commit | 04b4a6c37ac2250bc4e7230c24801d5cf9ffd8e7 (patch) | |
tree | 1e67976bfec449d5f6c4b209630491a4bfde3ffc /chrome/browser/render_view_host.h | |
parent | 9e43dae7106b6064ebc6580fe111568f1cbdd393 (diff) | |
download | chromium_src-04b4a6c37ac2250bc4e7230c24801d5cf9ffd8e7.zip chromium_src-04b4a6c37ac2250bc4e7230c24801d5cf9ffd8e7.tar.gz chromium_src-04b4a6c37ac2250bc4e7230c24801d5cf9ffd8e7.tar.bz2 |
A bunch of cleanups to beforeunload/unload handling.
1. Remove all the is_closing_browser plumbing. WebContents/TabContents/RenderViewHost/etc really shouldn't (and don't!) need to know anything about whether we're closing the browser or not.
2. Refactor the handling of beforeunload/unload state in browser.cc. I think this makes it considerably easier to reason about the correctness of it.
3. Added a couple TODOs for future cleanups that would have made this change a bit too large.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_host.h')
-rw-r--r-- | chrome/browser/render_view_host.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h index 488131a..a05659a 100644 --- a/chrome/browser/render_view_host.h +++ b/chrome/browser/render_view_host.h @@ -152,20 +152,19 @@ class RenderViewHost : public RenderWidgetHost { // Causes the renderer to invoke the onbeforeunload event handler. The // result will be returned via ViewMsg_ShouldClose. - virtual void AttemptToClosePage(bool is_closing_browser); + virtual void FirePageBeforeUnload(); // Close the page after the page has responded that it can be closed via // ViewMsg_ShouldClose. This is where the page itself is closed. The // unload handler is triggered here, which can block with a dialog, but cannot // cancel the close of the page. - virtual void OnProceedWithClosePage(bool is_closing_browser); + virtual void FirePageUnload(); // Close the page ignoring whether it has unload events registers. // This is called after the beforeunload and unload events have fired // and the user has agreed to continue with closing the page. static void ClosePageIgnoringUnloadEvents(int render_process_host_id, - int request_id, - bool is_closing_browser); + int request_id); // Causes the renderer to close the current page, including running its // onunload event handler. A ClosePage_ACK message will be sent to the @@ -173,8 +172,7 @@ class RenderViewHost : public RenderWidgetHost { // and |new_request_id| will help the ResourceDispatcherHost identify which // response is associated with this event. virtual void ClosePage(int new_render_process_host_id, - int new_request_id, - bool is_closing_browser); + int new_request_id); // Sets whether this RenderViewHost has an outstanding cross-site request, // for which another renderer will need to run an onunload event handler. @@ -502,7 +500,7 @@ class RenderViewHost : public RenderWidgetHost { void OnDidGetApplicationInfo(int32 page_id, const webkit_glue::WebApplicationInfo& info); - void OnMsgShouldCloseACK(bool proceed, bool is_closing_browser); + void OnMsgShouldCloseACK(bool proceed); void OnUnloadListenerChanged(bool has_handler); virtual void NotifyRendererUnresponsive(); |