Chromium Code Reviews| Index: ash/common/wm/overview/window_grid.cc |
| diff --git a/ash/common/wm/overview/window_grid.cc b/ash/common/wm/overview/window_grid.cc |
| index 1d894003172978ac3ee50b2f84790c6da834a424..52d7bc9d27af246dece7cb944b2284e9c6d809b8 100644 |
| --- a/ash/common/wm/overview/window_grid.cc |
| +++ b/ash/common/wm/overview/window_grid.cc |
| @@ -13,6 +13,8 @@ |
| #include "ash/common/ash_switches.h" |
| #include "ash/common/material_design/material_design_controller.h" |
| #include "ash/common/shell_window_ids.h" |
| +#include "ash/common/wm/overview/scoped_overview_animation_settings.h" |
| +#include "ash/common/wm/overview/scoped_overview_animation_settings_factory.h" |
| #include "ash/common/wm/overview/scoped_transform_overview_window.h" |
| #include "ash/common/wm/overview/window_selector.h" |
| #include "ash/common/wm/overview/window_selector_item.h" |
| @@ -94,7 +96,7 @@ const float kCardAspectRatio = 4.0f / 3.0f; |
| // landscape orientation). |
| const int kMinCardsMajor = 3; |
| -const int kOverviewSelectorTransitionMilliseconds = 200; |
| +const int kOverviewSelectorTransitionMilliseconds = 250; |
| // The color and opacity of the screen shield in overview. |
| const SkColor kShieldColor = SkColorSetARGB(178, 0, 0, 0); |
| @@ -729,6 +731,20 @@ void WindowGrid::FilterItems(const base::string16& pattern) { |
| } |
| } |
| +// Animates selector widget to |opacity|. |
|
bruthig
2016/07/04 17:06:22
Is this comment needed?
varkha
2016/07/04 18:01:30
Done (duplicated for some reason in the header, I
|
| +void WindowGrid::SetSelectorOpacity(float opacity) { |
| + if (!selection_widget_) |
| + return; |
| + WmWindow* selection_widget_window = |
| + WmLookup::Get()->GetWindowForWidget(selection_widget_.get()); |
| + std::unique_ptr<ScopedOverviewAnimationSettings> animation_settings_label = |
| + ScopedOverviewAnimationSettingsFactory::Get() |
| + ->CreateOverviewAnimationSettings( |
| + OverviewAnimationType::OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM, |
| + selection_widget_window); |
| + selection_widget_->SetOpacity(opacity); |
| +} |
| + |
| void WindowGrid::OnWindowDestroying(WmWindow* window) { |
| window->RemoveObserver(this); |
| observed_windows_.erase(window); |
| @@ -872,7 +888,7 @@ void WindowGrid::MoveSelectionWidgetToTarget(bool animate) { |
| selection_widget_window->GetLayer()->GetAnimator()); |
| animation_settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| kOverviewSelectorTransitionMilliseconds)); |
| - animation_settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); |
| + animation_settings.SetTweenType(gfx::Tween::EASE_IN_OUT); |
| animation_settings.SetPreemptionStrategy( |
| ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| selection_widget_->SetBounds(bounds); |