| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 transform_window_.RestoreWindow(); | 409 transform_window_.RestoreWindow(); |
| 410 if (background_view_) { | 410 if (background_view_) { |
| 411 background_view_->OnItemRestored(); | 411 background_view_->OnItemRestored(); |
| 412 background_view_ = nullptr; | 412 background_view_ = nullptr; |
| 413 } | 413 } |
| 414 UpdateHeaderLayout( | 414 UpdateHeaderLayout( |
| 415 HeaderFadeInMode::EXIT, | 415 HeaderFadeInMode::EXIT, |
| 416 OverviewAnimationType::OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS); | 416 OverviewAnimationType::OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS); |
| 417 } | 417 } |
| 418 | 418 |
| 419 void WindowSelectorItem::EnsureVisible() { |
| 420 transform_window_.EnsureVisible(); |
| 421 } |
| 422 |
| 419 void WindowSelectorItem::Shutdown() { | 423 void WindowSelectorItem::Shutdown() { |
| 420 if (transform_window_.GetTopInset()) { | 424 if (transform_window_.GetTopInset()) { |
| 421 // Activating a window (even when it is the window that was active before | 425 // Activating a window (even when it is the window that was active before |
| 422 // overview) results in stacking it at the top. Maintain the label window | 426 // overview) results in stacking it at the top. Maintain the label window |
| 423 // stacking position above the item to make the header transformation more | 427 // stacking position above the item to make the header transformation more |
| 424 // gradual upon exiting the overview mode. | 428 // gradual upon exiting the overview mode. |
| 425 WmWindow* label_window = | 429 WmWindow* label_window = |
| 426 WmLookup::Get()->GetWindowForWidget(window_label_.get()); | 430 WmLookup::Get()->GetWindowForWidget(window_label_.get()); |
| 427 | 431 |
| 428 // |label_window| was originally created in the same container as the | 432 // |label_window| was originally created in the same container as the |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 } | 526 } |
| 523 | 527 |
| 524 void WindowSelectorItem::ButtonPressed(views::Button* sender, | 528 void WindowSelectorItem::ButtonPressed(views::Button* sender, |
| 525 const ui::Event& event) { | 529 const ui::Event& event) { |
| 526 if (sender == close_button_) { | 530 if (sender == close_button_) { |
| 527 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON); | 531 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON); |
| 528 CloseWindow(); | 532 CloseWindow(); |
| 529 return; | 533 return; |
| 530 } | 534 } |
| 531 CHECK(sender == window_label_button_view_); | 535 CHECK(sender == window_label_button_view_); |
| 532 window_selector_->SelectWindow(transform_window_.window()); | 536 window_selector_->SelectWindow(this); |
| 533 } | 537 } |
| 534 | 538 |
| 535 void WindowSelectorItem::OnWindowDestroying(WmWindow* window) { | 539 void WindowSelectorItem::OnWindowDestroying(WmWindow* window) { |
| 536 window->RemoveObserver(this); | 540 window->RemoveObserver(this); |
| 537 transform_window_.OnWindowDestroyed(); | 541 transform_window_.OnWindowDestroyed(); |
| 538 } | 542 } |
| 539 | 543 |
| 540 void WindowSelectorItem::OnWindowTitleChanged(WmWindow* window) { | 544 void WindowSelectorItem::OnWindowTitleChanged(WmWindow* window) { |
| 541 // TODO(flackr): Maybe add the new title to a vector of titles so that we can | 545 // TODO(flackr): Maybe add the new title to a vector of titles so that we can |
| 542 // filter any of the titles the window had while in the overview session. | 546 // filter any of the titles the window had while in the overview session. |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 | 789 |
| 786 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { | 790 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { |
| 787 return background_view_ ? background_view_->animation() : nullptr; | 791 return background_view_ ? background_view_->animation() : nullptr; |
| 788 } | 792 } |
| 789 | 793 |
| 790 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { | 794 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { |
| 791 return transform_window_.GetOverviewWindowForMinimizedState(); | 795 return transform_window_.GetOverviewWindowForMinimizedState(); |
| 792 } | 796 } |
| 793 | 797 |
| 794 } // namespace ash | 798 } // namespace ash |
| OLD | NEW |