OLD | NEW |
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/common/wm/overview/window_selector_item.h" | 5 #include "ash/common/wm/overview/window_selector_item.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } | 420 } |
421 | 421 |
422 void WindowSelectorItem::Shutdown() { | 422 void WindowSelectorItem::Shutdown() { |
423 if (transform_window_.GetTopInset()) { | 423 if (transform_window_.GetTopInset()) { |
424 // Activating a window (even when it is the window that was active before | 424 // Activating a window (even when it is the window that was active before |
425 // overview) results in stacking it at the top. Maintain the label window | 425 // overview) results in stacking it at the top. Maintain the label window |
426 // stacking position above the item to make the header transformation more | 426 // stacking position above the item to make the header transformation more |
427 // gradual upon exiting the overview mode. | 427 // gradual upon exiting the overview mode. |
428 WmWindow* label_window = | 428 WmWindow* label_window = |
429 WmLookup::Get()->GetWindowForWidget(window_label_.get()); | 429 WmLookup::Get()->GetWindowForWidget(window_label_.get()); |
430 label_window->GetParent()->StackChildAbove(label_window, | 430 |
431 transform_window_.window()); | 431 // |label_window| was originally created in the same container as the |
| 432 // |transform_window_| but when closing overview the |transform_window_| |
| 433 // could have been reparented if a drag was active. Only change stacking |
| 434 // if the windows still belong to the same container. |
| 435 if (label_window->GetParent() == transform_window_.window()->GetParent()) { |
| 436 label_window->GetParent()->StackChildAbove(label_window, |
| 437 transform_window_.window()); |
| 438 } |
432 } | 439 } |
433 if (background_view_) { | 440 if (background_view_) { |
434 background_view_->OnItemRestored(); | 441 background_view_->OnItemRestored(); |
435 background_view_ = nullptr; | 442 background_view_ = nullptr; |
436 } | 443 } |
437 FadeOut(std::move(window_label_)); | 444 FadeOut(std::move(window_label_)); |
438 } | 445 } |
439 | 446 |
440 void WindowSelectorItem::ShowWindowOnExit() { | 447 void WindowSelectorItem::ShowWindowOnExit() { |
441 transform_window_.ShowWindowOnExit(); | 448 transform_window_.ShowWindowOnExit(); |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 window_selector_->delegate()->AddDelayedAnimationObserver( | 788 window_selector_->delegate()->AddDelayedAnimationObserver( |
782 std::move(observer)); | 789 std::move(observer)); |
783 widget_ptr->SetOpacity(0.f); | 790 widget_ptr->SetOpacity(0.f); |
784 } | 791 } |
785 | 792 |
786 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { | 793 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { |
787 return background_view_ ? background_view_->animation() : nullptr; | 794 return background_view_ ? background_view_->animation() : nullptr; |
788 } | 795 } |
789 | 796 |
790 } // namespace ash | 797 } // namespace ash |
OLD | NEW |