Chromium Code Reviews| Index: chrome/browser/ui/unload_controller.h |
| diff --git a/chrome/browser/ui/unload_controller.h b/chrome/browser/ui/unload_controller.h |
| index fb51668b0554bd67d563d351b8c5db5ee7081f75..4f7183d49cdc920d26753a8b86d745af0485fdb3 100644 |
| --- a/chrome/browser/ui/unload_controller.h |
| +++ b/chrome/browser/ui/unload_controller.h |
| @@ -23,6 +23,7 @@ class WebContents; |
| } |
| namespace chrome { |
| +class UnloadDetachedHandler; |
| class UnloadController : public content::NotificationObserver, |
|
Ben Goodger (Google)
2012/10/26 19:35:14
It would be good if you could codify your knowledg
slamm
2012/10/26 23:16:32
Done.
|
| public TabStripModelObserver { |
| @@ -62,6 +63,9 @@ class UnloadController : public content::NotificationObserver, |
| // could be pursued. |
| bool TabsNeedBeforeUnloadFired(); |
| + // Called when detached tabs (if any) finish closing. |
| + void DetachedTabsClosedCallback(); |
| + |
| private: |
| typedef std::set<content::WebContents*> UnloadListenerSet; |
| @@ -114,11 +118,11 @@ class UnloadController : public content::NotificationObserver, |
| content::NotificationRegistrar registrar_; |
| - // Tracks tabs that need there beforeunload event fired before we can |
| + // Tracks tabs that need their beforeunload event fired before we can |
| // close the browser. Only gets populated when we try to close the browser. |
| UnloadListenerSet tabs_needing_before_unload_fired_; |
| - // Tracks tabs that need there unload event fired before we can |
| + // Tracks tabs that need their unload event fired before we can |
| // close the browser. Only gets populated when we try to close the browser. |
| UnloadListenerSet tabs_needing_unload_fired_; |
| @@ -128,6 +132,9 @@ class UnloadController : public content::NotificationObserver, |
| // Browser window isn't just immediately closed. |
| bool is_attempting_to_close_browser_; |
| + // Allow unload handlers to run without holding up the UI. |
| + UnloadDetachedHandler* const unload_detached_handler_; |
| + |
| base::WeakPtrFactory<UnloadController> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(UnloadController); |