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

Side by Side Diff: ash/wm/ash_focus_rules.cc

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: remove ash:: Created 3 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « ash/test/ui_controls_factory_ash.cc ('k') | ash/wm/drag_window_resizer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/test/ui_controls_factory_ash.cc ('k') | ash/wm/drag_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698