Chromium Code Reviews| Index: chrome/browser/ui/browser.h |
| diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h |
| index e321e5d1324a306c5c9797713672d6fe5851ba1f..661281a168e26ec884d90c3ab605029c9504defb 100644 |
| --- a/chrome/browser/ui/browser.h |
| +++ b/chrome/browser/ui/browser.h |
| @@ -317,8 +317,7 @@ 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 |
| @@ -328,14 +327,17 @@ class Browser : public TabStripModelObserver, |
| // After calling this function, if the window will not be closed, call |
| // ResetBeforeUnloadHandlers() to reset all beforeunload handlers; calling |
|
sky
2017/02/13 16:55:51
Update comment.
|
| // this function multiple times without an intervening call to |
| - // ResetBeforeUnloadHandlers() will run only the beforeunload handlers |
| + // ResetCloseWindow() will run only the beforeunload handlers |
| // registered since the previous call. |
| - bool CallBeforeUnloadHandlers( |
| - const base::Callback<void(bool)>& on_close_confirmed); |
| + // If |skip_before_unload_event| is set to true, all prompting will be |
|
sky
2017/02/13 16:55:51
I'm confused by the behavior of skip_before_unload
|
| + // skipped as user confirm the dialog. |on_close_confirmed| will always |
| + // be called. |
| + 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 ResetCloseWindow(); |
|
sky
2017/02/13 16:55:51
It isn't obvious from this name it ties with TryTo
|
| // Figure out if there are tabs that have beforeunload handlers. |
| // It starts beforeunload/unload processing as a side-effect. |