Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar/app_menu_animation.cc |
| diff --git a/chrome/browser/ui/views/toolbar/app_menu_animation.cc b/chrome/browser/ui/views/toolbar/app_menu_animation.cc |
| index 8d643cade30dc8403f65a7f03e2f1a90f00d1fd5..3adfe5b2a27b22e15ac1c71df38cc0b79a566d4d 100644 |
| --- a/chrome/browser/ui/views/toolbar/app_menu_animation.cc |
| +++ b/chrome/browser/ui/views/toolbar/app_menu_animation.cc |
| @@ -124,10 +124,8 @@ void AppMenuAnimation::AppMenuDot::Paint(const gfx::PointF& center_point, |
| canvas->DrawRoundRect(gfx::RectF(point, dot_size), 2.0, flags); |
| } |
| -AppMenuAnimation::AppMenuAnimation(AppMenuButton* owner, |
| - bool should_animate_closed) |
| +AppMenuAnimation::AppMenuAnimation(AppMenuButton* owner, SkColor initial_color) |
| : owner_(owner), |
| - should_animate_closed_(should_animate_closed), |
| animation_(base::MakeUnique<gfx::SlideAnimation>(this)), |
| bottom_dot_(base::TimeDelta(), |
| kBottomWidthOpenInterval, |
| @@ -138,8 +136,8 @@ AppMenuAnimation::AppMenuAnimation(AppMenuButton* owner, |
| top_dot_(base::TimeDelta::FromMilliseconds(kDotDelayMs * 2), |
| kTopWidthOpenInterval, |
| kTopStrokeOpenInterval), |
| - start_color_(gfx::kPlaceholderColor), |
| - severity_color_(gfx::kPlaceholderColor) { |
| + start_color_(initial_color), |
| + severity_color_(initial_color) { |
| animation_->SetSlideDuration(kOpenDurationMs); |
| animation_->SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN); |
| } |
| @@ -164,12 +162,6 @@ void AppMenuAnimation::PaintAppMenu(gfx::Canvas* canvas, |
| animation_.get()); |
| } |
| -void AppMenuAnimation::SetIconColors(SkColor start_color, |
| - SkColor severity_color) { |
| - start_color_ = start_color; |
| - severity_color_ = severity_color; |
| -} |
| - |
| void AppMenuAnimation::StartAnimation() { |
| if (!animation_->is_animating()) { |
| animation_->SetSlideDuration(kOpenDurationMs); |
| @@ -179,14 +171,12 @@ void AppMenuAnimation::StartAnimation() { |
| } |
| void AppMenuAnimation::AnimationEnded(const gfx::Animation* animation) { |
| - if (animation_->IsShowing() && should_animate_closed_) { |
| + if (animation_->IsShowing()) { |
| animation_->SetSlideDuration(kCloseDurationMs); |
| animation_->Hide(); |
| - return; |
| - } |
| - |
| - if (!animation_->IsShowing()) |
| + } else if (!animation_->IsShowing()) { |
|
msw
2017/04/28 21:39:12
Remove the redundant "if (!animation_->IsShowing()
spqchan
2017/04/29 00:36:33
Done.
|
| start_color_ = severity_color_; |
| + } |
| owner_->AppMenuAnimationEnded(); |
| } |