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

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

Issue 2681203002: Add Browser::SkipCallBeforeUnload so that the browser windows can be closed regardless of beforeunl… (Closed)
Patch Set: cr - remove delegate in UnloadController Created 3 years, 9 months 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index d2063c2f561ca8edecea3ef93c812f62903d6b41..490f1f26cd23d0962ffe608cc5c1101ae5e6d359 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -656,28 +656,29 @@ void Browser::FormatTitleForDisplay(base::string16* title) {
bool Browser::ShouldCloseWindow() {
if (!CanCloseWithInProgressDownloads())
return false;
-
if (IsFastTabUnloadEnabled())
return fast_unload_controller_->ShouldCloseWindow();
return unload_controller_->ShouldCloseWindow();
}
-bool Browser::CallBeforeUnloadHandlers(
+bool Browser::TryToCloseWindow(
+ bool skip_beforeunload,
const base::Callback<void(bool)>& on_close_confirmed) {
cancel_download_confirmation_state_ = RESPONSE_RECEIVED;
if (IsFastTabUnloadEnabled()) {
- return fast_unload_controller_->CallBeforeUnloadHandlers(
- on_close_confirmed);
+ return fast_unload_controller_->TryToCloseWindow(skip_beforeunload,
+ on_close_confirmed);
}
- return unload_controller_->CallBeforeUnloadHandlers(on_close_confirmed);
+ return unload_controller_->TryToCloseWindow(skip_beforeunload,
+ on_close_confirmed);
}
-void Browser::ResetBeforeUnloadHandlers() {
+void Browser::ResetTryToCloseWindow() {
cancel_download_confirmation_state_ = NOT_PROMPTED;
if (IsFastTabUnloadEnabled())
- fast_unload_controller_->ResetBeforeUnloadHandlers();
+ fast_unload_controller_->ResetTryToCloseWindow();
else
- unload_controller_->ResetBeforeUnloadHandlers();
+ unload_controller_->ResetTryToCloseWindow();
}
bool Browser::HasCompletedUnloadProcessing() const {
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698