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

Unified Diff: chrome/browser/ui/fast_unload_controller.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_list.cc ('k') | chrome/browser/ui/fast_unload_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/fast_unload_controller.h
diff --git a/chrome/browser/ui/fast_unload_controller.h b/chrome/browser/ui/fast_unload_controller.h
index 4022a60a6a62a633ba589784a9632bd0933ae33b..c5a43084c18a123ed9fd915916a05438e84167fa 100644
--- a/chrome/browser/ui/fast_unload_controller.h
+++ b/chrome/browser/ui/fast_unload_controller.h
@@ -18,6 +18,7 @@
class Browser;
class TabStripModel;
+class UnloadControllerWebContentsDelegate;
namespace content {
class NotificationSource;
@@ -90,13 +91,14 @@ class FastUnloadController : public content::NotificationObserver,
bool ShouldCloseWindow();
// Begins the process of confirming whether the associated browser can be
- // closed.
- bool CallBeforeUnloadHandlers(
- const base::Callback<void(bool)>& on_close_confirmed);
+ // closed. Beforeunload events won't be fired if |skip_beforeunload|
+ // true.
+ bool TryToCloseWindow(bool skip_beforeunload,
+ 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();
// Returns true if |browser_| has any tabs that have BeforeUnload handlers
// that have not been fired. This method is non-const because it builds a list
@@ -140,8 +142,8 @@ class FastUnloadController : public content::NotificationObserver,
// Returns true if it succeeds.
bool DetachWebContents(content::WebContents* contents);
- // Processes the next tab that needs it's beforeunload/unload event fired.
- void ProcessPendingTabs();
+ // Processes the next tab that needs its beforeunload/unload event fired.
+ void ProcessPendingTabs(bool skip_beforeunload);
// Cleans up state appropriately when we are trying to close the
// browser or close a tab in the background. We also use this in the
@@ -156,6 +158,8 @@ class FastUnloadController : public content::NotificationObserver,
void LogUnloadStep(const base::StringPiece& step_name,
content::WebContents* contents) const;
+ void CancelTabNeedingBeforeUnloadAck();
+
bool is_calling_before_unload_handlers() {
return !on_close_confirmed_.is_null();
}
@@ -194,8 +198,7 @@ class FastUnloadController : public content::NotificationObserver,
base::Callback<void(bool)> on_close_confirmed_;
// Manage tabs with beforeunload/unload handlers that close detached.
- class DetachedWebContentsDelegate;
- std::unique_ptr<DetachedWebContentsDelegate> detached_delegate_;
+ std::unique_ptr<UnloadControllerWebContentsDelegate> detached_delegate_;
base::WeakPtrFactory<FastUnloadController> weak_factory_;
« no previous file with comments | « chrome/browser/ui/browser_list.cc ('k') | chrome/browser/ui/fast_unload_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698