| 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 transform_window_.RestoreWindow(); | 435 transform_window_.RestoreWindow(); |
| 436 if (background_view_) { | 436 if (background_view_) { |
| 437 background_view_->OnItemRestored(); | 437 background_view_->OnItemRestored(); |
| 438 background_view_ = nullptr; | 438 background_view_ = nullptr; |
| 439 } | 439 } |
| 440 UpdateHeaderLayout( | 440 UpdateHeaderLayout( |
| 441 HeaderFadeInMode::EXIT, | 441 HeaderFadeInMode::EXIT, |
| 442 OverviewAnimationType::OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS); | 442 OverviewAnimationType::OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS); |
| 443 } | 443 } |
| 444 | 444 |
| 445 void WindowSelectorItem::EnsureVisible() { |
| 446 transform_window_.EnsureVisible(); |
| 447 } |
| 448 |
| 445 void WindowSelectorItem::Shutdown() { | 449 void WindowSelectorItem::Shutdown() { |
| 446 if (transform_window_.GetTopInset()) { | 450 if (transform_window_.GetTopInset()) { |
| 447 // Activating a window (even when it is the window that was active before | 451 // Activating a window (even when it is the window that was active before |
| 448 // overview) results in stacking it at the top. Maintain the label window | 452 // overview) results in stacking it at the top. Maintain the label window |
| 449 // stacking position above the item to make the header transformation more | 453 // stacking position above the item to make the header transformation more |
| 450 // gradual upon exiting the overview mode. | 454 // gradual upon exiting the overview mode. |
| 451 WmWindow* widget_window = | 455 WmWindow* widget_window = |
| 452 WmLookup::Get()->GetWindowForWidget(item_widget_.get()); | 456 WmLookup::Get()->GetWindowForWidget(item_widget_.get()); |
| 453 | 457 |
| 454 // |widget_window| was originally created in the same container as the | 458 // |widget_window| was originally created in the same container as the |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 552 } |
| 549 | 553 |
| 550 void WindowSelectorItem::ButtonPressed(views::Button* sender, | 554 void WindowSelectorItem::ButtonPressed(views::Button* sender, |
| 551 const ui::Event& event) { | 555 const ui::Event& event) { |
| 552 if (sender == close_button_) { | 556 if (sender == close_button_) { |
| 553 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON); | 557 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON); |
| 554 CloseWindow(); | 558 CloseWindow(); |
| 555 return; | 559 return; |
| 556 } | 560 } |
| 557 CHECK(sender == caption_container_view_->listener_button()); | 561 CHECK(sender == caption_container_view_->listener_button()); |
| 558 window_selector_->SelectWindow(transform_window_.window()); | 562 window_selector_->SelectWindow(this); |
| 559 } | 563 } |
| 560 | 564 |
| 561 void WindowSelectorItem::OnWindowDestroying(WmWindow* window) { | 565 void WindowSelectorItem::OnWindowDestroying(WmWindow* window) { |
| 562 window->RemoveObserver(this); | 566 window->RemoveObserver(this); |
| 563 transform_window_.OnWindowDestroyed(); | 567 transform_window_.OnWindowDestroyed(); |
| 564 } | 568 } |
| 565 | 569 |
| 566 void WindowSelectorItem::OnWindowTitleChanged(WmWindow* window) { | 570 void WindowSelectorItem::OnWindowTitleChanged(WmWindow* window) { |
| 567 // TODO(flackr): Maybe add the new title to a vector of titles so that we can | 571 // TODO(flackr): Maybe add the new title to a vector of titles so that we can |
| 568 // filter any of the titles the window had while in the overview session. | 572 // filter any of the titles the window had while in the overview session. |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 | 792 |
| 789 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { | 793 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { |
| 790 return background_view_ ? background_view_->animation() : nullptr; | 794 return background_view_ ? background_view_->animation() : nullptr; |
| 791 } | 795 } |
| 792 | 796 |
| 793 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { | 797 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { |
| 794 return transform_window_.GetOverviewWindowForMinimizedState(); | 798 return transform_window_.GetOverviewWindowForMinimizedState(); |
| 795 } | 799 } |
| 796 | 800 |
| 797 } // namespace ash | 801 } // namespace ash |
| OLD | NEW |