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

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: sky's comments Created 3 years, 10 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
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 3abed6c03e97efdec77f487d398acf3f4d424355..a0cc596f858278b6292b67089f894d9ff720f5e9 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -643,28 +643,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_before_unload_event,
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_before_unload_event,
+ on_close_confirmed);
}
- return unload_controller_->CallBeforeUnloadHandlers(on_close_confirmed);
+ return unload_controller_->TryToCloseWindow(skip_before_unload_event,
+ 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 {

Powered by Google App Engine
This is Rietveld 408576698