| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura_shell/stacking_controller.h" | 5 #include "ui/aura_shell/stacking_controller.h" |
| 6 | 6 |
| 7 #include "ui/aura/desktop.h" | 7 #include "ui/aura/desktop.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/aura_shell/shell.h" | 9 #include "ui/aura_shell/shell.h" |
| 10 #include "ui/aura_shell/shell_window_ids.h" | 10 #include "ui/aura_shell/shell_window_ids.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 StackingController::~StackingController() { | 35 StackingController::~StackingController() { |
| 36 } | 36 } |
| 37 | 37 |
| 38 // static | 38 // static |
| 39 aura::Window* StackingController::GetActivatableWindow(aura::Window* window) { | 39 aura::Window* StackingController::GetActivatableWindow(aura::Window* window) { |
| 40 aura::Window* parent = window->parent(); | 40 aura::Window* parent = window->parent(); |
| 41 aura::Window* child = window; | 41 aura::Window* child = window; |
| 42 while (parent) { | 42 while (parent) { |
| 43 if (SupportsChildActivation(parent)) | 43 if (SupportsChildActivation(parent)) |
| 44 return child; | 44 return child; |
| 45 // If |child| isn't activatable, but has transient parent, trace |
| 46 // that path instead. |
| 47 if (child->transient_parent()) |
| 48 return GetActivatableWindow(child->transient_parent()); |
| 45 parent = parent->parent(); | 49 parent = parent->parent(); |
| 46 child = child->parent(); | 50 child = child->parent(); |
| 47 } | 51 } |
| 48 return false; | 52 return false; |
| 49 } | 53 } |
| 50 | 54 |
| 51 //////////////////////////////////////////////////////////////////////////////// | 55 //////////////////////////////////////////////////////////////////////////////// |
| 52 // StackingController, aura::StackingClient implementation: | 56 // StackingController, aura::StackingClient implementation: |
| 53 | 57 |
| 54 void StackingController::AddChildToDefaultParent(aura::Window* window) { | 58 void StackingController::AddChildToDefaultParent(aura::Window* window) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 90 } |
| 87 return NULL; | 91 return NULL; |
| 88 } | 92 } |
| 89 | 93 |
| 90 | 94 |
| 91 //////////////////////////////////////////////////////////////////////////////// | 95 //////////////////////////////////////////////////////////////////////////////// |
| 92 // StackingController, private: | 96 // StackingController, private: |
| 93 | 97 |
| 94 } // namespace internal | 98 } // namespace internal |
| 95 } // namespace aura_shell | 99 } // namespace aura_shell |
| OLD | NEW |