| Index: ui/views/widget/desktop_aura/desktop_activation_client.cc
|
| ===================================================================
|
| --- ui/views/widget/desktop_aura/desktop_activation_client.cc (revision 170295)
|
| +++ ui/views/widget/desktop_aura/desktop_activation_client.cc (working copy)
|
| @@ -100,6 +100,23 @@
|
| return current_active_;
|
| }
|
|
|
| +aura::Window* DesktopActivationClient::GetActivatableWindow(
|
| + aura::Window* window) {
|
| + aura::Window* parent = window->parent();
|
| + aura::Window* child = window;
|
| + while (parent) {
|
| + if (CanActivateWindow(child))
|
| + return child;
|
| + // If |child| isn't activatable, but has transient parent, trace
|
| + // that path instead.
|
| + if (child->transient_parent())
|
| + return GetActivatableWindow(child->transient_parent());
|
| + parent = parent->parent();
|
| + child = child->parent();
|
| + }
|
| + return NULL;
|
| +}
|
| +
|
| bool DesktopActivationClient::OnWillFocusWindow(aura::Window* window,
|
| const ui::Event* event) {
|
| return CanActivateWindow(GetActivatableWindow(window));
|
| @@ -156,23 +173,6 @@
|
| return ui::ER_UNHANDLED;
|
| }
|
|
|
| -aura::Window* DesktopActivationClient::GetActivatableWindow(
|
| - aura::Window* window) {
|
| - aura::Window* parent = window->parent();
|
| - aura::Window* child = window;
|
| - while (parent) {
|
| - if (CanActivateWindow(child))
|
| - return child;
|
| - // If |child| isn't activatable, but has transient parent, trace
|
| - // that path instead.
|
| - if (child->transient_parent())
|
| - return GetActivatableWindow(child->transient_parent());
|
| - parent = parent->parent();
|
| - child = child->parent();
|
| - }
|
| - return NULL;
|
| -}
|
| -
|
| void DesktopActivationClient::FocusWindowWithEvent(const ui::Event* event) {
|
| aura::Window* window = static_cast<aura::Window*>(event->target());
|
| if (GetActiveWindow() != window) {
|
|
|