| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/ash_focus_rules.h" | 5 #include "ash/wm/ash_focus_rules.h" |
| 6 | 6 |
| 7 #include "ash/common/wm/container_finder.h" | 7 #include "ash/common/wm/container_finder.h" |
| 8 #include "ash/common/wm/focus_rules.h" | 8 #include "ash/common/wm/focus_rules.h" |
| 9 #include "ash/common/wm/mru_window_tracker.h" | 9 #include "ash/common/wm/mru_window_tracker.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 std::vector<WmWindow*> windows = mru->BuildMruWindowList(); | 84 std::vector<WmWindow*> windows = mru->BuildMruWindowList(); |
| 85 aura::Window* starting_window = | 85 aura::Window* starting_window = |
| 86 windows.empty() ? ignore : WmWindow::GetAuraWindow(windows[0]); | 86 windows.empty() ? ignore : WmWindow::GetAuraWindow(windows[0]); |
| 87 | 87 |
| 88 // Look for windows to focus in |starting_window|'s container. If none are | 88 // Look for windows to focus in |starting_window|'s container. If none are |
| 89 // found, we look in all the containers in front of |starting_window|'s | 89 // found, we look in all the containers in front of |starting_window|'s |
| 90 // container, then all behind. | 90 // container, then all behind. |
| 91 int starting_container_index = 0; | 91 int starting_container_index = 0; |
| 92 aura::Window* root = starting_window->GetRootWindow(); | 92 aura::Window* root = starting_window->GetRootWindow(); |
| 93 if (!root) | 93 if (!root) |
| 94 root = Shell::GetTargetRootWindow(); | 94 root = Shell::GetRootWindowForNewWindows(); |
| 95 int container_count = static_cast<int>(kNumActivatableShellWindowIds); | 95 int container_count = static_cast<int>(kNumActivatableShellWindowIds); |
| 96 for (int i = 0; i < container_count; i++) { | 96 for (int i = 0; i < container_count; i++) { |
| 97 aura::Window* container = | 97 aura::Window* container = |
| 98 Shell::GetContainer(root, kActivatableShellWindowIds[i]); | 98 Shell::GetContainer(root, kActivatableShellWindowIds[i]); |
| 99 if (container && container->Contains(starting_window)) { | 99 if (container && container->Contains(starting_window)) { |
| 100 starting_container_index = i; | 100 starting_container_index = i; |
| 101 break; | 101 break; |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 WindowState* window_state = GetWindowState(*i); | 140 WindowState* window_state = GetWindowState(*i); |
| 141 if (*i != ignore && window_state->CanActivate() && | 141 if (*i != ignore && window_state->CanActivate() && |
| 142 !window_state->IsMinimized()) | 142 !window_state->IsMinimized()) |
| 143 return *i; | 143 return *i; |
| 144 } | 144 } |
| 145 return NULL; | 145 return NULL; |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace wm | 148 } // namespace wm |
| 149 } // namespace ash | 149 } // namespace ash |
| OLD | NEW |