| Index: ash/common/wm/overview/window_selector_item.cc
|
| diff --git a/ash/common/wm/overview/window_selector_item.cc b/ash/common/wm/overview/window_selector_item.cc
|
| index 1943920c2b16776fbba32149c6b2051a89776cbd..8483975f105d2e7f10b934bac221cbb9ca9e4e79 100644
|
| --- a/ash/common/wm/overview/window_selector_item.cc
|
| +++ b/ash/common/wm/overview/window_selector_item.cc
|
| @@ -390,6 +390,26 @@ void WindowSelectorItem::SendAccessibleSelectionEvent() {
|
| true);
|
| }
|
|
|
| +void WindowSelectorItem::CloseWindow() {
|
| + if (ash::MaterialDesignController::IsOverviewMaterial()) {
|
| + gfx::Rect inset_bounds(target_bounds_);
|
| + inset_bounds.Inset(target_bounds_.width() * kPreCloseScale,
|
| + target_bounds_.height() * kPreCloseScale);
|
| + OverviewAnimationType animation_type =
|
| + OverviewAnimationType::OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM;
|
| + // Scale down both the window and label.
|
| + SetBounds(inset_bounds, animation_type);
|
| + // First animate opacity to an intermediate value concurrently with the
|
| + // scaling animation.
|
| + AnimateOpacity(kClosingItemOpacity, animation_type);
|
| +
|
| + // Fade out the window and the label, effectively hiding them.
|
| + AnimateOpacity(
|
| + 0.0, OverviewAnimationType::OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM);
|
| + }
|
| + transform_window_.Close();
|
| +}
|
| +
|
| void WindowSelectorItem::SetDimmed(bool dimmed) {
|
| dimmed_ = dimmed;
|
| SetOpacity(dimmed ? kDimmedItemOpacity : 1.0f);
|
| @@ -398,23 +418,7 @@ void WindowSelectorItem::SetDimmed(bool dimmed) {
|
| void WindowSelectorItem::ButtonPressed(views::Button* sender,
|
| const ui::Event& event) {
|
| if (sender == close_button_) {
|
| - if (ash::MaterialDesignController::IsOverviewMaterial()) {
|
| - gfx::Rect inset_bounds(target_bounds_);
|
| - inset_bounds.Inset(target_bounds_.width() * kPreCloseScale,
|
| - target_bounds_.height() * kPreCloseScale);
|
| - OverviewAnimationType animation_type =
|
| - OverviewAnimationType::OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM;
|
| - // Scale down both the window and label.
|
| - SetBounds(inset_bounds, animation_type);
|
| - // First animate opacity to an intermediate value concurrently with the
|
| - // scaling animation.
|
| - AnimateOpacity(kClosingItemOpacity, animation_type);
|
| -
|
| - // Fade out the window and the label, effectively hiding them.
|
| - AnimateOpacity(
|
| - 0.0, OverviewAnimationType::OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM);
|
| - }
|
| - transform_window_.Close();
|
| + CloseWindow();
|
| return;
|
| }
|
| CHECK(sender == window_label_button_view_);
|
|
|