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

Unified Diff: chrome/browser/ui/browser_list_impl.cc

Issue 10829007: Revert 148281 - Remove details from BROWSER_CLOSING and BROWSER_CLOSED notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/tabs/pinned_tab_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_list_impl.cc
===================================================================
--- chrome/browser/ui/browser_list_impl.cc (revision 148288)
+++ chrome/browser/ui/browser_list_impl.cc (working copy)
@@ -70,10 +70,28 @@
void BrowserListImpl::RemoveBrowser(Browser* browser) {
RemoveBrowserFrom(browser, &last_active_browsers_);
+ // Many UI tests rely on closing the last browser window quitting the
+ // application.
+ // Mac: Closing all windows does not indicate quitting the application. Lie
+ // for now and ignore behavior outside of unit tests.
+ // ChromeOS: Force closing last window to close app with flag.
+ // TODO(andybons | pkotwicz): Fix the UI tests to Do The Right Thing.
+#if defined(OS_CHROMEOS)
+ bool closing_app;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableZeroBrowsersOpenForTests))
+ closing_app = (browsers_.size() == 1);
+ else
+ closing_app = (browsers_.size() == 1 &&
+ browser_shutdown::IsTryingToQuit());
+#else
+ bool closing_app = (browsers_.size() == 1);
+#endif // OS_CHROMEOS
+
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_BROWSER_CLOSED,
content::Source<Browser>(browser),
- content::NotificationService::NoDetails());
+ content::Details<bool>(&closing_app));
RemoveBrowserFrom(browser, &browsers_);
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/tabs/pinned_tab_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698