Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index b0176688f775286b0e3ee3a46b9bc944ad689b86..faea131d799e9fd8fb6f46cb63ec34e7ecac1dd5 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -15,6 +15,7 @@ |
#include "ash/drag_drop/drag_drop_controller.h" |
#include "ash/focus_cycler.h" |
#include "ash/high_contrast/high_contrast_controller.h" |
+#include "ash/hostwm/host_window_manager.h" |
#include "ash/launcher/launcher.h" |
#include "ash/magnifier/magnification_controller.h" |
#include "ash/display/display_controller.h" |
@@ -101,6 +102,10 @@ |
#include "ui/aura/dispatcher_linux.h" |
#endif // defined(OS_CHROMEOS) |
+#if defined(USE_X11) |
+#include "ui/aura/hostwm/host_window_manager_x11.h" |
+#endif |
+ |
namespace ash { |
namespace { |
@@ -191,6 +196,13 @@ Shell::Shell(ShellDelegate* delegate) |
} |
Shell::~Shell() { |
+#if defined(USE_X11) |
+ x11_host_window_manager_.reset(); |
+#endif |
+ |
+ // This holds a pointer to the host_window_manager_ that we own. |
+ host_window_manager_.reset(); |
+ |
views::FocusManagerFactory::Install(NULL); |
// Remove the focus from any window. This will prevent overhead and side |
@@ -357,6 +369,15 @@ std::vector<aura::Window*> Shell::GetAllContainers(int container_id) { |
} |
void Shell::Init() { |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kAuraEnableHostWindowManagement)) { |
+ host_window_manager_.reset(new internal::HostWindowManager); |
+#if defined(USE_X11) |
+ x11_host_window_manager_.reset(new aura::HostWindowManagerX11( |
+ host_window_manager_.get())); |
+#endif |
+ } |
+ |
// Install the custom factory first so that views::FocusManagers for Tray, |
// Launcher, and WallPaper could be created by the factory. |
views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
@@ -497,6 +518,11 @@ void Shell::Init() { |
if (initially_hide_cursor_) |
aura::Env::GetInstance()->cursor_manager()->ShowCursor(false); |
+ |
+#if defined(USE_X11) |
+ if (x11_host_window_manager_.get()) |
+ x11_host_window_manager_->Init(); |
+#endif |
} |
void Shell::AddEnvEventFilter(aura::EventFilter* filter) { |