Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index 832153b86e17201770479a2f4bfa17284c823b52..8c13ca4f13ad81a56d1fbafaebd620874e951392 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -746,6 +746,8 @@ void Browser::OnWindowClosing() { |
if (tab_restore_service && is_type_tabbed() && tab_strip_model_->count()) |
tab_restore_service->BrowserClosing(live_tab_context()); |
+ BrowserList::NotifyBrowserWindowClosing(this); |
+ |
// TODO(sky): convert session/tab restore to use notification. |
content::NotificationService::current()->Notify( |
chrome::NOTIFICATION_BROWSER_CLOSING, |
@@ -2556,7 +2558,10 @@ bool Browser::ShouldHideUIForFullscreen() const { |
} |
bool Browser::ShouldStartShutdown() const { |
- return BrowserList::GetInstance()->size() <= 1; |
+ DCHECK_GE(BrowserList::GetInstance()->size(), |
+ BrowserList::GetInstance()->currently_closing_browsers_count()); |
+ return (BrowserList::GetInstance()->size() - |
+ BrowserList::GetInstance()->currently_closing_browsers_count()) <= 1; |
sky
2017/03/31 14:23:41
Why do you need the <= 1? Shouldn't it be size() +
Alexey Seren
2017/04/02 12:02:35
Yes you are right. Equality checking will allow to
|
} |
bool Browser::MaybeCreateBackgroundContents( |