Chromium Code Reviews| Index: athena/wm/window_overview_mode.cc |
| diff --git a/athena/wm/window_overview_mode.cc b/athena/wm/window_overview_mode.cc |
| index b34991cf82d7a7341ac17c77d016f1cda20e0dc9..814bc6cc011c358cbdd722680a2e2eab094a041b 100644 |
| --- a/athena/wm/window_overview_mode.cc |
| +++ b/athena/wm/window_overview_mode.cc |
| @@ -442,21 +442,47 @@ class WindowOverviewModeImpl : public WindowOverviewMode, |
| dragged_window_->SetTransform(transform); |
| dragged_window_->layer()->SetOpacity(kMinOpacity); |
| - // Move the windows behind |dragged_window_| in the stack forward one step. |
| - const aura::Window::Windows& list = container_->children(); |
| - for (aura::Window::Windows::const_iterator iter = list.begin(); |
| - iter != list.end() && *iter != dragged_window_; |
| - ++iter) { |
| - aura::Window* window = *iter; |
| - ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); |
| - settings.SetPreemptionStrategy( |
| - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| - |
| - aura::Window* next = *(iter + 1); |
| - WindowOverviewState* next_state = next->GetProperty(kWindowOverviewState); |
| - UpdateTerminalStateForWindowAtIndex(window, list.end() - iter, |
| - list.size()); |
| - SetWindowProgress(window, next_state->progress); |
| + const aura::Window::Windows list = window_list_provider_->GetWindowList(); |
| + if (list.empty()) |
|
oshima
2014/09/03 19:50:35
CHECK? (if you have dragged_window_, this shouldn'
sadrul
2014/09/03 20:24:36
Good point. Done.
|
| + return; |
| + if (list.front() == dragged_window_) { |
| + // There's no window behind |dragged_window_|. So move the windows in |
| + // front take a step back. |
| + for (aura::Window::Windows::const_reverse_iterator iter = list.rbegin(); |
| + iter != list.rend() && *iter != dragged_window_; |
| + ++iter) { |
| + aura::Window* window = *iter; |
| + ui::ScopedLayerAnimationSettings settings( |
| + window->layer()->GetAnimator()); |
| + settings.SetPreemptionStrategy( |
| + ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| + |
| + aura::Window* next = *(iter + 1); |
| + WindowOverviewState* next_state = |
| + next->GetProperty(kWindowOverviewState); |
| + UpdateTerminalStateForWindowAtIndex( |
| + window, iter - list.rbegin(), list.size()); |
| + SetWindowProgress(window, next_state->progress); |
| + } |
| + } else { |
| + // Move the windows behind |dragged_window_| in the stack forward one |
| + // step. |
| + for (aura::Window::Windows::const_iterator iter = list.begin(); |
| + iter != list.end() && *iter != dragged_window_; |
| + ++iter) { |
| + aura::Window* window = *iter; |
| + ui::ScopedLayerAnimationSettings settings( |
| + window->layer()->GetAnimator()); |
| + settings.SetPreemptionStrategy( |
| + ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| + |
| + aura::Window* next = *(iter + 1); |
| + WindowOverviewState* next_state = |
| + next->GetProperty(kWindowOverviewState); |
| + UpdateTerminalStateForWindowAtIndex( |
| + window, list.end() - iter, list.size()); |
| + SetWindowProgress(window, next_state->progress); |
| + } |
| } |
| dragged_window_ = NULL; |