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

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

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.cc ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_list.h
diff --git a/chrome/browser/ui/browser_list.h b/chrome/browser/ui/browser_list.h
index dfd13387e96bc90df6e4aa3239793fff9dcc6d0d..705e423d97708612cc9059cef1158f78ee55769e 100644
--- a/chrome/browser/ui/browser_list.h
+++ b/chrome/browser/ui/browser_list.h
@@ -88,13 +88,17 @@ class BrowserList {
static void CloseAllBrowsersWithProfile(Profile* profile);
// Closes all browsers for |profile| across all desktops. Uses
- // TryToCloseBrowserList() to do the actual closing and trigger any
- // OnBeforeUnload events. If all OnBeforeUnload events are confirmed,
- // |on_close_success| is called, otherwise |on_close_aborted| is called.
- static void CloseAllBrowsersWithProfile(
- Profile* profile,
- const CloseCallback& on_close_success,
- const CloseCallback& on_close_aborted);
+ // TryToCloseBrowserList() to do the actual closing. Trigger any
+ // OnBeforeUnload events if |if_force| is false. If all OnBeforeUnload events
+ // are confirmed or |skip_beforeunload| is true, |on_close_success| is called,
+ // otherwise |on_close_aborted| is called.
+ // Note that if there is any browser window has been used before, user
+ // should always has a chance to save his or her work before closing windows
+ // without trigger beforeunload event.
+ static void CloseAllBrowsersWithProfile(Profile* profile,
+ const CloseCallback& on_close_success,
+ const CloseCallback& on_close_aborted,
+ bool skip_beforeunload);
// Returns true if at least one incognito session is active across all
// desktops.
@@ -116,26 +120,27 @@ class BrowserList {
// |on_close_success| will be called, with a parameter of |profile_path|,
// and the Browsers will then be closed. If at least one unfired
// OnBeforeUnload event is found, handle it with a callback to
- // PostBeforeUnloadHandlers, which upon success will recursively call this
+ // PostTryToCloseBrowserWindow, which upon success will recursively call this
// method to handle any other OnBeforeUnload events. If aborted in the
- // OnBeforeUnload event, PostBeforeUnloadHandlers will call |on_close_aborted|
- // instead and reset all OnBeforeUnload event handlers.
- static void TryToCloseBrowserList(
- const BrowserVector& browsers_to_close,
- const CloseCallback& on_close_success,
- const CloseCallback& on_close_aborted,
- const base::FilePath& profile_path);
+ // OnBeforeUnload event, PostTryToCloseBrowserWindow will call
+ // |on_close_aborted| instead and reset all OnBeforeUnload event handlers.
+ static void TryToCloseBrowserList(const BrowserVector& browsers_to_close,
+ const CloseCallback& on_close_success,
+ const CloseCallback& on_close_aborted,
+ const base::FilePath& profile_path,
+ const bool skip_beforeunload);
// Called after handling an OnBeforeUnload event. If |tab_close_confirmed| is
// true, calls |TryToCloseBrowserList()|, passing the parameters
// |browsers_to_close|, |on_close_success|, |on_close_aborted|, and
// |profile_path|. Otherwise, resets all the OnBeforeUnload event handlers and
// calls |on_close_aborted|.
- static void PostBeforeUnloadHandlers(
+ static void PostTryToCloseBrowserWindow(
const BrowserVector& browsers_to_close,
const CloseCallback& on_close_success,
const CloseCallback& on_close_aborted,
const base::FilePath& profile_path,
+ const bool skip_beforeunload,
bool tab_close_confirmed);
// A vector of the browsers in this list, in the order they were added.
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698