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

Side by Side Diff: trunk/src/ash/wm/mru_window_tracker.cc

Issue 59153004: Revert 233787 "Eliminate Shell::RootWindowList in favor of aura:..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/mru_window_tracker.h" 5 #include "ash/wm/mru_window_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/session_state_delegate.h" 9 #include "ash/session_state_delegate.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 // Returns a list of windows ordered by their stacking order. 52 // Returns a list of windows ordered by their stacking order.
53 // If |mru_windows| is passed, these windows are moved to the front of the list. 53 // If |mru_windows| is passed, these windows are moved to the front of the list.
54 // If |top_most_at_end|, the list is returned in descending (bottom-most / least 54 // If |top_most_at_end|, the list is returned in descending (bottom-most / least
55 // recently used) order. 55 // recently used) order.
56 MruWindowTracker::WindowList BuildWindowListInternal( 56 MruWindowTracker::WindowList BuildWindowListInternal(
57 const std::list<aura::Window*>* mru_windows, 57 const std::list<aura::Window*>* mru_windows,
58 bool top_most_at_end) { 58 bool top_most_at_end) {
59 MruWindowTracker::WindowList windows; 59 MruWindowTracker::WindowList windows;
60 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 60 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
61 61
62 aura::Window* active_root = Shell::GetTargetRootWindow(); 62 aura::Window* active_root = Shell::GetTargetRootWindow();
63 for (aura::Window::Windows::const_iterator iter = root_windows.begin(); 63 for (Shell::RootWindowList::const_iterator iter = root_windows.begin();
64 iter != root_windows.end(); ++iter) { 64 iter != root_windows.end(); ++iter) {
65 if (*iter == active_root) 65 if (*iter == active_root)
66 continue; 66 continue;
67 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) 67 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i)
68 AddTrackedWindows(*iter, kSwitchableWindowContainerIds[i], &windows); 68 AddTrackedWindows(*iter, kSwitchableWindowContainerIds[i], &windows);
69 } 69 }
70 70
71 // Add windows in the active root windows last so that the topmost window 71 // Add windows in the active root windows last so that the topmost window
72 // in the active root window becomes the front of the list. 72 // in the active root window becomes the front of the list.
73 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) 73 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 if (!ignore_window_activations_) 189 if (!ignore_window_activations_)
190 SetActiveWindow(gained_active); 190 SetActiveWindow(gained_active);
191 } 191 }
192 192
193 void MruWindowTracker::OnWindowDestroying(aura::Window* window) { 193 void MruWindowTracker::OnWindowDestroying(aura::Window* window) {
194 mru_windows_.remove(window); 194 mru_windows_.remove(window);
195 window->RemoveObserver(this); 195 window->RemoveObserver(this);
196 } 196 }
197 197
198 } // namespace ash 198 } // namespace ash
OLDNEW
« no previous file with comments | « trunk/src/ash/wm/immersive_fullscreen_controller_unittest.cc ('k') | trunk/src/ash/wm/overview/window_overview.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698