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

Unified Diff: athena/wm/window_overview_mode.cc

Issue 531093003: athena: Move windows in the stack backwards if the back-most window is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698