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

Unified Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 11434013: In Chrome ASH on Windows 8 make sure that the browser object is closed before destroying it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
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);
« no previous file with comments | « chrome/browser/lifetime/application_lifetime.h ('k') | chrome/browser/metro_viewer/metro_viewer_process_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698