| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 } | 489 } |
| 490 FadeOut(std::move(window_label_)); | 490 FadeOut(std::move(window_label_)); |
| 491 } | 491 } |
| 492 | 492 |
| 493 void WindowSelectorItem::ShowWindowOnExit() { | 493 void WindowSelectorItem::ShowWindowOnExit() { |
| 494 transform_window_.ShowWindowOnExit(); | 494 transform_window_.ShowWindowOnExit(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 void WindowSelectorItem::PrepareForOverview() { | 497 void WindowSelectorItem::PrepareForOverview() { |
| 498 transform_window_.PrepareForOverview(); | 498 transform_window_.PrepareForOverview(); |
| 499 UpdateHeaderLayout(HeaderFadeInMode::ENTER, |
| 500 OverviewAnimationType::OVERVIEW_ANIMATION_NONE); |
| 499 } | 501 } |
| 500 | 502 |
| 501 bool WindowSelectorItem::Contains(const WmWindow* target) const { | 503 bool WindowSelectorItem::Contains(const WmWindow* target) const { |
| 502 return transform_window_.Contains(target); | 504 return transform_window_.Contains(target); |
| 503 } | 505 } |
| 504 | 506 |
| 505 void WindowSelectorItem::SetBounds(const gfx::Rect& target_bounds, | 507 void WindowSelectorItem::SetBounds(const gfx::Rect& target_bounds, |
| 506 OverviewAnimationType animation_type) { | 508 OverviewAnimationType animation_type) { |
| 507 if (in_bounds_update_) | 509 if (in_bounds_update_) |
| 508 return; | 510 return; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // the parent layer bounds change during the animation since | 760 // the parent layer bounds change during the animation since |
| 759 // Shadow::UpdateLayerBounds() only happens before the animation starts. | 761 // Shadow::UpdateLayerBounds() only happens before the animation starts. |
| 760 if (ash::MaterialDesignController::GetMode() == | 762 if (ash::MaterialDesignController::GetMode() == |
| 761 ash::MaterialDesignController::Mode::MATERIAL_EXPERIMENTAL) { | 763 ash::MaterialDesignController::Mode::MATERIAL_EXPERIMENTAL) { |
| 762 shadow_.reset(new ::wm::Shadow()); | 764 shadow_.reset(new ::wm::Shadow()); |
| 763 shadow_->Init(::wm::Shadow::STYLE_INACTIVE); | 765 shadow_->Init(::wm::Shadow::STYLE_INACTIVE); |
| 764 shadow_->layer()->SetVisible(true); | 766 shadow_->layer()->SetVisible(true); |
| 765 window_label_->GetLayer()->Add(shadow_->layer()); | 767 window_label_->GetLayer()->Add(shadow_->layer()); |
| 766 } | 768 } |
| 767 window_label_->GetLayer()->SetMasksToBounds(false); | 769 window_label_->GetLayer()->SetMasksToBounds(false); |
| 768 UpdateHeaderLayout(HeaderFadeInMode::ENTER, | |
| 769 OverviewAnimationType::OVERVIEW_ANIMATION_NONE); | |
| 770 } else { | 770 } else { |
| 771 // Indicate that the label will be drawn onto a transparent background | 771 // Indicate that the label will be drawn onto a transparent background |
| 772 // (disables subpixel antialiasing). | 772 // (disables subpixel antialiasing). |
| 773 window_label_button_view_->SetBackgroundColorHint(SK_ColorTRANSPARENT); | 773 window_label_button_view_->SetBackgroundColorHint(SK_ColorTRANSPARENT); |
| 774 window_label_->SetContentsView(window_label_button_view_); | 774 window_label_->SetContentsView(window_label_button_view_); |
| 775 } | 775 } |
| 776 } | 776 } |
| 777 | 777 |
| 778 void WindowSelectorItem::UpdateHeaderLayout( | 778 void WindowSelectorItem::UpdateHeaderLayout( |
| 779 HeaderFadeInMode mode, | 779 HeaderFadeInMode mode, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 window_selector_->delegate()->AddDelayedAnimationObserver( | 901 window_selector_->delegate()->AddDelayedAnimationObserver( |
| 902 std::move(observer)); | 902 std::move(observer)); |
| 903 widget_ptr->SetOpacity(0.f); | 903 widget_ptr->SetOpacity(0.f); |
| 904 } | 904 } |
| 905 | 905 |
| 906 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { | 906 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { |
| 907 return background_view_ ? background_view_->animation() : nullptr; | 907 return background_view_ ? background_view_->animation() : nullptr; |
| 908 } | 908 } |
| 909 | 909 |
| 910 } // namespace ash | 910 } // namespace ash |
| OLD | NEW |