Chromium Code Reviews| Index: athena/screen/screen_manager_impl.cc |
| diff --git a/athena/screen/screen_manager_impl.cc b/athena/screen/screen_manager_impl.cc |
| index a154d522f2edcec74117a63d3aacab35e7fd2054..9817b79c71379aec01bd4a3bad44bc9e8ef9b8f4 100644 |
| --- a/athena/screen/screen_manager_impl.cc |
| +++ b/athena/screen/screen_manager_impl.cc |
| @@ -25,6 +25,7 @@ |
| #include "ui/wm/core/base_focus_rules.h" |
| #include "ui/wm/core/capture_controller.h" |
| #include "ui/wm/core/focus_controller.h" |
| +#include "ui/wm/core/window_util.h" |
| namespace athena { |
| namespace { |
| @@ -43,10 +44,9 @@ bool GrabsInput(aura::Window* container) { |
| // Returns the container which contains |window|. |
| aura::Window* GetContainer(aura::Window* window) { |
| - // No containers for NULL or the root window itself. |
| - if (!window || !window->parent()) |
| + if (!window) |
| return NULL; |
| - if (window->parent()->IsRootWindow()) |
| + if (window->GetProperty(kContainerParamsKey)) |
| return window; |
| return GetContainer(window->parent()); |
|
oshima
2014/09/04 15:04:53
this is not your fault, but you can change to use
mohsen
2014/09/04 15:39:54
Sure; Done.
|
| } |
| @@ -95,6 +95,9 @@ class AthenaWindowTreeClient : public aura::client::WindowTreeClient { |
| virtual aura::Window* GetDefaultParent(aura::Window* context, |
| aura::Window* window, |
| const gfx::Rect& bounds) OVERRIDE { |
| + aura::Window* transient_parent = wm::GetTransientParent(window); |
| + if (transient_parent) |
| + return GetContainer(transient_parent); |
| return container_; |
| } |