summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 03:33:42 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 03:33:42 +0000
commit46ca36338f43a9a1298c188110cd9defacac04cc (patch)
tree0b95a62a435ca06dbfdaaf3c3d6e014e94834bbf /ui
parent5d24b9087d1fee42eb6a8b8f4cb0adef26d20732 (diff)
downloadchromium_src-46ca36338f43a9a1298c188110cd9defacac04cc.zip
chromium_src-46ca36338f43a9a1298c188110cd9defacac04cc.tar.gz
chromium_src-46ca36338f43a9a1298c188110cd9defacac04cc.tar.bz2
Put workspace manager behind --aura-windows flag
BUG=none TEST=none Review URL: http://codereview.chromium.org/8439054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura_shell/shell.cc30
-rw-r--r--ui/aura_shell/shell.h3
2 files changed, 25 insertions, 8 deletions
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc
index 358f29b..659bfc8 100644
--- a/ui/aura_shell/shell.cc
+++ b/ui/aura_shell/shell.cc
@@ -5,6 +5,8 @@
#include "ui/aura_shell/shell.h"
#include "base/bind.h"
+#include "base/command_line.h"
+#include "ui/aura/aura_switches.h"
#include "ui/aura/desktop.h"
#include "ui/aura/screen_aura.h"
#include "ui/aura/toplevel_window_container.h"
@@ -43,8 +45,6 @@ void CreateSpecialContainers(aura::Window::Windows* containers) {
aura::Window* default_container = new aura::ToplevelWindowContainer;
default_container->set_id(internal::kShellWindowId_DefaultContainer);
- default_container->SetEventFilter(
- new internal::DefaultContainerEventFilter(default_container));
containers->push_back(default_container);
aura::Window* always_on_top_container = new aura::ToplevelWindowContainer;
@@ -126,11 +126,8 @@ void Shell::Init() {
launcher_->widget()->GetWindowScreenBounds().height(),
kWorkAreaHorizontalMargin));
- workspace_controller_.reset(
- new internal::WorkspaceController(toplevel_container));
- toplevel_container->SetLayoutManager(
- new internal::DefaultContainerLayoutManager(
- workspace_controller_->workspace_manager()));
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraWindows))
+ EnableWorkspaceManager();
// Force a layout.
desktop_layout->OnWindowResized();
@@ -150,7 +147,24 @@ const aura::Window* Shell::GetContainer(int container_id) const {
}
void Shell::ToggleOverview() {
- workspace_controller_->ToggleOverview();
+ if (workspace_controller_.get())
+ workspace_controller_->ToggleOverview();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Shell, private:
+
+void Shell::EnableWorkspaceManager() {
+ aura::Window* default_container =
+ GetContainer(internal::kShellWindowId_DefaultContainer);
+
+ workspace_controller_.reset(
+ new internal::WorkspaceController(default_container));
+ default_container->SetEventFilter(
+ new internal::DefaultContainerEventFilter(default_container));
+ default_container->SetLayoutManager(
+ new internal::DefaultContainerLayoutManager(
+ workspace_controller_->workspace_manager()));
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/ui/aura_shell/shell.h b/ui/aura_shell/shell.h
index 36386b4..4f872ab 100644
--- a/ui/aura_shell/shell.h
+++ b/ui/aura_shell/shell.h
@@ -61,6 +61,9 @@ class AURA_SHELL_EXPORT Shell : public aura::DesktopDelegate {
private:
typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
+ // Enables WorkspaceManager.
+ void EnableWorkspaceManager();
+
// Overridden from aura::DesktopDelegate:
virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE;
virtual aura::Window* GetTopmostWindowToActivate(