Index: athena/wm/window_manager_impl.cc |
diff --git a/athena/wm/window_manager_impl.cc b/athena/wm/window_manager_impl.cc |
index bd93b2350cbca65bc48af2ab0addf40162dae5b7..97f03ad628440b664f6ed09e7f0a6682d49e8fa1 100644 |
--- a/athena/wm/window_manager_impl.cc |
+++ b/athena/wm/window_manager_impl.cc |
@@ -68,7 +68,8 @@ AthenaContainerLayoutManager::~AthenaContainerLayoutManager() { |
void AthenaContainerLayoutManager::OnWindowResized() { |
// Resize all the existing windows. |
- aura::Window::Windows list = instance->window_list_provider_->GetWindowList(); |
+ aura::Window::Windows list = |
+ instance->window_list_provider_->GetCurrentWindowList(); |
const gfx::Size work_area = |
gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size(); |
bool is_splitview = instance->split_view_controller_->IsSplitViewModeActive(); |
@@ -98,7 +99,8 @@ void AthenaContainerLayoutManager::OnWindowResized() { |
} |
void AthenaContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
- aura::Window::Windows list = instance->window_list_provider_->GetWindowList(); |
+ aura::Window::Windows list = |
+ instance->window_list_provider_->GetCurrentWindowList(); |
if (std::find(list.begin(), list.end(), child) == list.end()) |
return; |
if (instance->split_view_controller_->IsSplitViewModeActive()) { |
@@ -184,11 +186,8 @@ void WindowManagerImpl::SetInOverview(bool active) { |
if (active) { |
FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeEnter()); |
- // Re-stack all windows in the order defined by window_list_provider_. |
- aura::Window::Windows window_list = window_list_provider_->GetWindowList(); |
- aura::Window::Windows::iterator it; |
- for (it = window_list.begin(); it != window_list.end(); ++it) |
- container_->StackChildAtTop(*it); |
+ // Note: The window_list_provider_ resembles the exact window list of the |
+ // container, so no re-stacking is required before showing the OverviewMode. |
overview_ = WindowOverviewMode::Create( |
container_.get(), window_list_provider_.get(), |
split_view_controller_.get(), this); |
@@ -221,6 +220,10 @@ void WindowManagerImpl::ToggleSplitViewForTest() { |
ToggleSplitview(); |
} |
+WindowListProvider* WindowManagerImpl::GetWindowListProvider() { |
+ return window_list_provider_.get(); |
+} |
+ |
void WindowManagerImpl::OnSelectWindow(aura::Window* window) { |
if (split_view_controller_->IsSplitViewModeActive()) { |
split_view_controller_->DeactivateSplitMode(); |
@@ -299,7 +302,7 @@ void WindowManagerImpl::ToggleSplitview() { |
FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnSplitViewModeExit()); |
// Relayout so that windows are maximzied. |
container_->layout_manager()->OnWindowResized(); |
- } else if (window_list_provider_->GetWindowList().size() > 1) { |
+ } else if (window_list_provider_->GetCurrentWindowList().size() > 1) { |
FOR_EACH_OBSERVER(WindowManagerObserver, |
observers_, |
OnSplitViewModeEnter()); |
@@ -308,7 +311,8 @@ void WindowManagerImpl::ToggleSplitview() { |
} |
aura::Window* WindowManagerImpl::GetWindowBehind(aura::Window* window) { |
- const aura::Window::Windows& windows = window_list_provider_->GetWindowList(); |
+ const aura::Window::Windows& windows = |
+ window_list_provider_->GetCurrentWindowList(); |
aura::Window::Windows::const_reverse_iterator iter = |
std::find(windows.rbegin(), windows.rend(), window); |
CHECK(iter != windows.rend()); |