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

Unified Diff: apps/app_window_registry.cc

Issue 220373003: Prevent Chrome from quitting when apps are open. (Mac) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 6 years, 8 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 | « apps/app_window_registry.h ('k') | chrome/app/chromium_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_window_registry.cc
diff --git a/apps/app_window_registry.cc b/apps/app_window_registry.cc
index 62ba2e1df00a7c56ba6e32236c9217e4e86b7d2a..4ed0b8bbd9a6258c45f216cb10f8f88f034bc595 100644
--- a/apps/app_window_registry.cc
+++ b/apps/app_window_registry.cc
@@ -242,6 +242,24 @@ bool AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(
return false;
}
+// static
+void AppWindowRegistry::CloseAllAppWindows() {
+ std::vector<content::BrowserContext*> contexts =
+ AppsClient::Get()->GetLoadedBrowserContexts();
+ for (std::vector<content::BrowserContext*>::const_iterator i =
+ contexts.begin();
+ i != contexts.end();
+ ++i) {
+ AppWindowRegistry* registry =
+ Factory::GetForBrowserContext(*i, false /* create */);
+ if (!registry)
+ continue;
+
+ while (!registry->app_windows().empty())
+ registry->app_windows().front()->GetBaseWindow()->Close();
+ }
+}
+
void AppWindowRegistry::OnDevToolsStateChanged(
content::DevToolsAgentHost* agent_host,
bool attached) {
« no previous file with comments | « apps/app_window_registry.h ('k') | chrome/app/chromium_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698