summaryrefslogtreecommitdiffstats
path: root/ui/aura_shell
diff options
context:
space:
mode:
Diffstat (limited to 'ui/aura_shell')
-rw-r--r--ui/aura_shell/root_window_event_filter_unittest.cc7
-rw-r--r--ui/aura_shell/shell.cc8
-rw-r--r--ui/aura_shell/shell.h2
-rw-r--r--ui/aura_shell/stacking_controller.cc11
-rw-r--r--ui/aura_shell/stacking_controller.h3
-rw-r--r--ui/aura_shell/toplevel_window_event_filter_unittest.cc9
-rw-r--r--ui/aura_shell/workspace/workspace_manager_unittest.cc7
7 files changed, 15 insertions, 32 deletions
diff --git a/ui/aura_shell/root_window_event_filter_unittest.cc b/ui/aura_shell/root_window_event_filter_unittest.cc
index d53cdc8..80ff962 100644
--- a/ui/aura_shell/root_window_event_filter_unittest.cc
+++ b/ui/aura_shell/root_window_event_filter_unittest.cc
@@ -31,14 +31,11 @@ class RootWindowEventFilterTest : public aura::test::AuraTestBase {
aura::RootWindow::GetInstance()->SetEventFilter(
new internal::RootWindowEventFilter);
- aura::test::TestStackingClient* stacking_client =
- static_cast<aura::test::TestStackingClient*>(
- aura::RootWindow::GetInstance()->stacking_client());
- stacking_client->default_container()->set_id(
+ GetTestStackingClient()->default_container()->set_id(
internal::kShellWindowId_DefaultContainer);
activation_controller_.reset(new internal::ActivationController);
activation_controller_->set_default_container_for_test(
- stacking_client->default_container());
+ GetTestStackingClient()->default_container());
}
virtual ~RootWindowEventFilterTest() {
aura::RootWindow::GetInstance()->SetEventFilter(NULL);
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc
index 51c1b99..b9aaca5 100644
--- a/ui/aura_shell/shell.cc
+++ b/ui/aura_shell/shell.cc
@@ -120,8 +120,6 @@ Shell::Shell(ShellDelegate* delegate)
delegate_(delegate) {
aura::RootWindow::GetInstance()->SetEventFilter(
new internal::RootWindowEventFilter);
- aura::RootWindow::GetInstance()->SetStackingClient(
- new internal::StackingController);
}
Shell::~Shell() {
@@ -192,10 +190,8 @@ void Shell::Init() {
(*i)->Show();
}
- internal::StackingController* stacking_controller =
- static_cast<internal::StackingController*>(
- root_window->stacking_client());
- stacking_controller->Init();
+ // This is created after the special containers, since it expects them.
+ stacking_controller_.reset(new internal::StackingController);
internal::RootWindowLayoutManager* root_window_layout =
new internal::RootWindowLayoutManager(root_window);
diff --git a/ui/aura_shell/shell.h b/ui/aura_shell/shell.h
index 80f5060..6006340 100644
--- a/ui/aura_shell/shell.h
+++ b/ui/aura_shell/shell.h
@@ -37,6 +37,7 @@ class AppList;
class DragDropController;
class ShadowController;
class ShellAcceleratorFilter;
+class StackingController;
class WorkspaceController;
}
@@ -113,6 +114,7 @@ class AURA_SHELL_EXPORT Shell {
scoped_ptr<internal::AppList> app_list_;
+ scoped_ptr<internal::StackingController> stacking_controller_;
scoped_ptr<internal::ActivationController> activation_controller_;
scoped_ptr<internal::DragDropController> drag_drop_controller_;
scoped_ptr<internal::WorkspaceController> workspace_controller_;
diff --git a/ui/aura_shell/stacking_controller.cc b/ui/aura_shell/stacking_controller.cc
index dba6da1..dedf726 100644
--- a/ui/aura_shell/stacking_controller.cc
+++ b/ui/aura_shell/stacking_controller.cc
@@ -29,19 +29,16 @@ bool IsWindowModal(aura::Window* window) {
// StackingController, public:
StackingController::StackingController() {
- aura::RootWindow::GetInstance()->SetStackingClient(this);
-}
-
-StackingController::~StackingController() {
-}
-
-void StackingController::Init() {
+ aura::StackingClient::SetStackingClient(this);
always_on_top_controller_.reset(new internal::AlwaysOnTopController);
always_on_top_controller_->SetContainers(
GetContainer(internal::kShellWindowId_DefaultContainer),
GetContainer(internal::kShellWindowId_AlwaysOnTopContainer));
}
+StackingController::~StackingController() {
+}
+
////////////////////////////////////////////////////////////////////////////////
// StackingController, aura::StackingClient implementation:
diff --git a/ui/aura_shell/stacking_controller.h b/ui/aura_shell/stacking_controller.h
index d7b2edd..bd6430f 100644
--- a/ui/aura_shell/stacking_controller.h
+++ b/ui/aura_shell/stacking_controller.h
@@ -21,9 +21,6 @@ class StackingController : public aura::StackingClient {
StackingController();
virtual ~StackingController();
- // Initializes this controller.
- void Init();
-
// Overridden from aura::StackingClient:
virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE;
diff --git a/ui/aura_shell/toplevel_window_event_filter_unittest.cc b/ui/aura_shell/toplevel_window_event_filter_unittest.cc
index f4cc00e..c366693 100644
--- a/ui/aura_shell/toplevel_window_event_filter_unittest.cc
+++ b/ui/aura_shell/toplevel_window_event_filter_unittest.cc
@@ -67,12 +67,9 @@ class ToplevelWindowEventFilterTest : public aura::test::AuraTestBase {
virtual void SetUp() OVERRIDE {
aura::test::AuraTestBase::SetUp();
- aura::Window* default_container =
- static_cast<aura::test::TestStackingClient*>(
- aura::RootWindow::GetInstance()->stacking_client())->
- default_container();
- default_container->SetEventFilter(
- new ToplevelWindowEventFilter(default_container));
+ GetTestStackingClient()->default_container()->SetEventFilter(
+ new ToplevelWindowEventFilter(
+ GetTestStackingClient()->default_container()));
}
protected:
diff --git a/ui/aura_shell/workspace/workspace_manager_unittest.cc b/ui/aura_shell/workspace/workspace_manager_unittest.cc
index 91e72b5..77b9d19 100644
--- a/ui/aura_shell/workspace/workspace_manager_unittest.cc
+++ b/ui/aura_shell/workspace/workspace_manager_unittest.cc
@@ -80,14 +80,11 @@ namespace internal {
class WorkspaceManagerTestBase : public aura::test::AuraTestBase {
public:
WorkspaceManagerTestBase() {
- aura::test::TestStackingClient* stacking_client =
- static_cast<aura::test::TestStackingClient*>(
- aura::RootWindow::GetInstance()->stacking_client());
- stacking_client->default_container()->set_id(
+ GetTestStackingClient()->default_container()->set_id(
internal::kShellWindowId_DefaultContainer);
activation_controller_.reset(new internal::ActivationController);
activation_controller_->set_default_container_for_test(
- stacking_client->default_container());
+ GetTestStackingClient()->default_container());
}
virtual ~WorkspaceManagerTestBase() {}