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

Unified Diff: ui/aura_shell/stacking_controller.cc

Issue 8916020: Second attempt at moving the StackingClient to a property on the RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « ui/aura_shell/stacking_controller.h ('k') | ui/aura_shell/toplevel_window_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/stacking_controller.cc
===================================================================
--- ui/aura_shell/stacking_controller.cc (revision 114527)
+++ ui/aura_shell/stacking_controller.cc (working copy)
@@ -29,43 +29,35 @@
// StackingController, public:
StackingController::StackingController() {
- aura::RootWindow::GetInstance()->SetStackingClient(this);
-}
-
-StackingController::~StackingController() {
-}
-
-void StackingController::Init() {
+ aura::client::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:
-void StackingController::AddChildToDefaultParent(aura::Window* window) {
- aura::Window* parent = NULL;
+aura::Window* StackingController::GetDefaultParent(aura::Window* window) {
switch (window->type()) {
case aura::WINDOW_TYPE_NORMAL:
case aura::WINDOW_TYPE_POPUP:
- if (IsWindowModal(window)) {
- parent = GetModalContainer(window);
- break;
- }
- parent = always_on_top_controller_->GetContainer(window);
- break;
+ if (IsWindowModal(window))
+ return GetModalContainer(window);
+ return always_on_top_controller_->GetContainer(window);
case aura::WINDOW_TYPE_MENU:
case aura::WINDOW_TYPE_TOOLTIP:
- parent = GetContainer(internal::kShellWindowId_MenusAndTooltipsContainer);
- break;
+ return GetContainer(internal::kShellWindowId_MenusAndTooltipsContainer);
default:
NOTREACHED() << "Window " << window->id()
<< " has unhandled type " << window->type();
break;
}
- parent->AddChild(window);
+ return NULL;
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/aura_shell/stacking_controller.h ('k') | ui/aura_shell/toplevel_window_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698