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

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

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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.h
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index e321e5d1324a306c5c9797713672d6fe5851ba1f..be615d9a19ea3af33449d5efa229e1138cdf0961 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -317,25 +317,26 @@ class Browser : public TabStripModelObserver,
// Gives beforeunload handlers the chance to cancel the close. Returns whether
// to proceed with the close. If called while the process begun by
- // CallBeforeUnloadHandlers is in progress, returns false without taking
- // action.
+ // TryToCloseWindow is in progress, returns false without taking action.
bool ShouldCloseWindow();
// Begins the process of confirming whether the associated browser can be
// closed. If there are no tabs with beforeunload handlers it will immediately
// return false. Otherwise, it starts prompting the user, returns true and
- // will call |on_close_confirmed| with the result of the user's decision.
+ // will call |on_close_confirmed| with the result of the user's decision. If
+ // |skip_before_unload_event| is true, beforeunload handlers will be skipped
+ // and window closing will be confirmed without showing the prompting.
sky 2017/02/13 23:12:53 prompting -> prompt
// After calling this function, if the window will not be closed, call
// ResetBeforeUnloadHandlers() to reset all beforeunload handlers; calling
// this function multiple times without an intervening call to
- // ResetBeforeUnloadHandlers() will run only the beforeunload handlers
+ // ResetTryToCloseWindow() will run only the beforeunload handlers
// registered since the previous call.
- bool CallBeforeUnloadHandlers(
- const base::Callback<void(bool)>& on_close_confirmed);
+ bool TryToCloseWindow(bool skip_before_unload_event,
+ const base::Callback<void(bool)>& on_close_confirmed);
// Clears the results of any beforeunload confirmation dialogs triggered by a
- // CallBeforeUnloadHandlers call.
- void ResetBeforeUnloadHandlers();
+ // TryToCloseWindow call.
+ void ResetTryToCloseWindow();
// Figure out if there are tabs that have beforeunload handlers.
// It starts beforeunload/unload processing as a side-effect.
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698