Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8892)

Unified Diff: chrome/browser/ui/browser.cc

Issue 11016023: Quickly close tabs/window with long-running unload handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep original TabsNeedBeforeUnloadFired implementation. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 1f51288ea43ee20795f3f00f14a20958bbb88992..af237aecc5a678f584747808acdbc4cac57a4fb3 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -601,14 +601,15 @@ bool Browser::ShouldCloseWindow() {
return unload_controller_->ShouldCloseWindow();
}
+bool Browser::TabsNeedBeforeUnloadFired() {
+ return unload_controller_->TabsNeedBeforeUnloadFired();
+}
+
bool Browser::IsAttemptingToCloseBrowser() const {
return unload_controller_->is_attempting_to_close_browser();
}
void Browser::OnWindowClosing() {
- if (!ShouldCloseWindow())
- return;
-
// Application should shutdown on last window close if the user is explicitly
// trying to quit, or if there is nothing keeping the browser alive (such as
// AppController on the Mac, or BackgroundContentsService for background
@@ -646,6 +647,10 @@ void Browser::OnWindowClosing() {
chrome::CloseAllTabs(this);
}
+void Browser::OnUnloadProcessingCompleted() {
+ CloseFrame();
+}
+
void Browser::OnWindowActivated() {
// On some platforms we want to automatically reload tabs that are
// killed when the user selects them.
@@ -1217,10 +1222,6 @@ void Browser::HandleKeyboardEvent(content::WebContents* source,
window()->HandleKeyboardEvent(event);
}
-bool Browser::TabsNeedBeforeUnloadFired() {
- return unload_controller_->TabsNeedBeforeUnloadFired();
-}
-
bool Browser::IsMouseLocked() const {
return fullscreen_controller_->IsMouseLocked();
}

Powered by Google App Engine
This is Rietveld 408576698