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

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

Issue 2766543002: Move even more from WmShell to Shell (Closed)
Patch Set: 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/virtual_keyboard_controller_unittest.cc ('k') | ash/wm/lock_state_controller_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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return true; 73 return true;
74 } 74 }
75 75
76 aura::Window* AshFocusRules::GetNextActivatableWindow( 76 aura::Window* AshFocusRules::GetNextActivatableWindow(
77 aura::Window* ignore) const { 77 aura::Window* ignore) const {
78 DCHECK(ignore); 78 DCHECK(ignore);
79 79
80 // Start from the container of the most-recently-used window. If the list of 80 // Start from the container of the most-recently-used window. If the list of
81 // MRU windows is empty, then start from the container of the window that just 81 // MRU windows is empty, then start from the container of the window that just
82 // lost focus |ignore|. 82 // lost focus |ignore|.
83 MruWindowTracker* mru = WmShell::Get()->mru_window_tracker(); 83 MruWindowTracker* mru = Shell::Get()->mru_window_tracker();
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)
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 WindowState* window_state = GetWindowState(*i); 139 WindowState* window_state = GetWindowState(*i);
140 if (*i != ignore && window_state->CanActivate() && 140 if (*i != ignore && window_state->CanActivate() &&
141 !window_state->IsMinimized()) 141 !window_state->IsMinimized())
142 return *i; 142 return *i;
143 } 143 }
144 return NULL; 144 return NULL;
145 } 145 }
146 146
147 } // namespace wm 147 } // namespace wm
148 } // namespace ash 148 } // namespace ash
OLDNEW
« no previous file with comments | « ash/virtual_keyboard_controller_unittest.cc ('k') | ash/wm/lock_state_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698