summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-27 19:00:05 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-27 19:00:05 +0000
commitde773bf33612f25bc38b31535889a9aee9a1af83 (patch)
tree74111301fb0837f4d320ea07381881d088c18b33 /chrome/browser/browser.cc
parentfb9846b4550d2bc633824fcceb0d8ef89674ffc5 (diff)
downloadchromium_src-de773bf33612f25bc38b31535889a9aee9a1af83.zip
chromium_src-de773bf33612f25bc38b31535889a9aee9a1af83.tar.gz
chromium_src-de773bf33612f25bc38b31535889a9aee9a1af83.tar.bz2
Make downloads not prevent tabs from closing.
If a download creates a cross-site transition (for example, if you click a link in Gmail that results in a download in a new tab), that tab will be stuck and you can't close it or the browser. This is the opposite problem with a similar cause as bug 16246. In both cases we were using some secondary signal to tell us if we're closing for a cross site transition or closing the tab, and that signal was wrong. In this case, we were running the onunload handler, but because there was a pending RenderViewHost, the RenderManager would think that the close was a cross-site one, and not forward the close message to actually close the tab. This patch adds a flag to the on unload handlers that indicates whether it's for a tab closure or a cross-site transition, so we can do the right thing unambiguously when the message returns. In this case I keep this information in the RenderView in case we send multiple close requests, we'll close the tab if any of them were for the entire tab, even if that particular one was dropped because we don't want to have more than one in flight at once. BUG=17560 TEST=none. Review URL: http://codereview.chromium.org/160122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index c400d48..3f54397 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1563,7 +1563,7 @@ bool Browser::RunUnloadListenerBeforeClosing(TabContents* contents) {
// them. Once they have fired, we'll get a message back saying whether
// to proceed closing the page or not, which sends us back to this method
// with the HasUnloadListener bit cleared.
- contents->render_view_host()->FirePageBeforeUnload();
+ contents->render_view_host()->FirePageBeforeUnload(false);
return true;
}
return false;
@@ -2476,7 +2476,7 @@ void Browser::ProcessPendingTabs() {
// Null check render_view_host here as this gets called on a PostTask and
// the tab's render_view_host may have been nulled out.
if (tab->render_view_host()) {
- tab->render_view_host()->FirePageBeforeUnload();
+ tab->render_view_host()->FirePageBeforeUnload(false);
} else {
ClearUnloadState(tab);
}