Chromium Code Reviews| Index: chrome/browser/lifetime/application_lifetime.cc |
| =================================================================== |
| --- chrome/browser/lifetime/application_lifetime.cc (revision 169752) |
| +++ chrome/browser/lifetime/application_lifetime.cc (working copy) |
| @@ -16,6 +16,7 @@ |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/ui/browser.h" |
| +#include "chrome/browser/ui/browser_list_impl.h" |
| #include "chrome/browser/ui/browser_tabstrip.h" |
| #include "chrome/browser/ui/browser_window.h" |
| #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| @@ -206,6 +207,18 @@ |
| } |
| } |
| +void CloseAllBrowsersOfType(chrome::HostDesktopType type) { |
| + chrome::BrowserListImpl* ash_browser_list = |
| + chrome::BrowserListImpl::GetInstance(type); |
| + if (ash_browser_list) { |
| + for (chrome::BrowserListImpl::const_iterator i = ash_browser_list->begin(); |
| + i != ash_browser_list->end(); ++i) { |
| + Browser* browser = *i; |
| + browser->window()->Close(); |
|
sky
2012/11/29 01:53:27
What if the close is vetoed for some reason?
ananta
2012/11/29 02:39:41
I added a comment explaining this. The CloseAllBro
|
| + } |
| + } |
| +} |
| + |
| void AttemptUserExit() { |
| #if defined(OS_CHROMEOS) |
| chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); |