Commit 08524b00 authored by Taylor Bergquist's avatar Taylor Bergquist Committed by Commit Bot

Tabstrip animations respect gfx::Animation::ShouldRenderRichAnimations.

This allows tabstrip animations to be disabled during tests and with
various operating system settings.

Bug: 8944
Change-Id: I56d7edb7fd3c05f98e2ada0b3e14efaef5cf9ae4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1812131Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
Commit-Queue: Charlene Yan <cyan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697836}
parent 0a6ece11
...@@ -501,6 +501,11 @@ TabStripLayoutHelper::GetCurrentTabWidthConstraints() const { ...@@ -501,6 +501,11 @@ TabStripLayoutHelper::GetCurrentTabWidthConstraints() const {
void TabStripLayoutHelper::AnimateSlot(int slots_index, void TabStripLayoutHelper::AnimateSlot(int slots_index,
TabAnimationState target_state) { TabAnimationState target_state) {
slots_[slots_index].animation->AnimateTo(target_state); slots_[slots_index].animation->AnimateTo(target_state);
if (!gfx::Animation::ShouldRenderRichAnimation()) {
slots_[slots_index].animation->CompleteAnimation();
on_animation_progressed_.Run();
return;
}
if (!animation_timer_.IsRunning()) { if (!animation_timer_.IsRunning()) {
animation_timer_.Start(FROM_HERE, kTickInterval, this, animation_timer_.Start(FROM_HERE, kTickInterval, this,
&TabStripLayoutHelper::TickAnimations); &TabStripLayoutHelper::TickAnimations);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment