Index: apps/shell/browser/shell_browser_main_parts.cc |
diff --git a/apps/shell/browser/shell_browser_main_parts.cc b/apps/shell/browser/shell_browser_main_parts.cc |
index 6532351affeec1d31272092b50cec855bb608edb..7fe3050f4247796e6382e05e238911bd1ca6c5b4 100644 |
--- a/apps/shell/browser/shell_browser_main_parts.cc |
+++ b/apps/shell/browser/shell_browser_main_parts.cc |
@@ -4,6 +4,7 @@ |
#include "apps/shell/browser/shell_browser_main_parts.h" |
+#include "apps/shell/browser/shell_apps_client.h" |
#include "apps/shell/browser/shell_browser_context.h" |
#include "apps/shell/browser/shell_extension_system.h" |
#include "apps/shell/browser/shell_extension_system_factory.h" |
@@ -111,6 +112,9 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() { |
new extensions::ShellExtensionsBrowserClient(browser_context_.get())); |
extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); |
+ apps_client_.reset(new ShellAppsClient(browser_context_.get())); |
+ AppsClient::Set(apps_client_.get()); |
+ |
// Create our custom ExtensionSystem first because other |
// BrowserContextKeyedServices depend on it. |
// TODO(yoz): Move this after EnsureBrowserContextKeyedServiceFactoriesBuilt. |
@@ -163,6 +167,7 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() { |
void ShellBrowserMainParts::OnWindowTreeHostCloseRequested( |
const aura::RootWindow* root) { |
+ extension_system_->CloseApp(); |
base::MessageLoop::current()->PostTask(FROM_HERE, |
base::MessageLoop::QuitClosure()); |
} |