Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: ui/views/animation/ink_drop_highlight.cc

Issue 2520353004: Disabled ink drop animations based on gfx::Animation::ShouldRenderRichAnimation(). (Closed)
Patch Set: Updated comment wording. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_ripple.cc ('k') | ui/views/animation/square_ink_drop_ripple.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_highlight.cc
diff --git a/ui/views/animation/ink_drop_highlight.cc b/ui/views/animation/ink_drop_highlight.cc
index 12202a26fce3e38eaa938559723ce283cba299f8..83303bbcaa403e219e7221087ecfb328045dc8e6 100644
--- a/ui/views/animation/ink_drop_highlight.cc
+++ b/ui/views/animation/ink_drop_highlight.cc
@@ -9,6 +9,7 @@
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
+#include "ui/gfx/animation/animation.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/animation/ink_drop_highlight_observer.h"
#include "ui/views/animation/ink_drop_painted_layer_delegates.h"
@@ -94,6 +95,11 @@ void InkDropHighlight::AnimateFade(AnimationType animation_type,
const base::TimeDelta& duration,
const gfx::Size& initial_size,
const gfx::Size& target_size) {
+ // Ink drop animations are controlled by the system animation settings for
+ // accessibility reasons."See https://crbug.com/658384.
+ const base::TimeDelta effective_duration =
+ gfx::Animation::ShouldRenderRichAnimation() ? duration
+ : base::TimeDelta();
last_animation_initiated_was_fade_in_ = animation_type == FADE_IN;
layer_->SetTransform(CalculateTransform(initial_size));
@@ -116,7 +122,7 @@ void InkDropHighlight::AnimateFade(AnimationType animation_type,
ui::LayerAnimationElement* opacity_element =
ui::LayerAnimationElement::CreateOpacityElement(
animation_type == FADE_IN ? visible_opacity_ : kHiddenOpacity,
- duration);
+ effective_duration);
ui::LayerAnimationSequence* opacity_sequence =
new ui::LayerAnimationSequence(opacity_element);
opacity_sequence->AddObserver(animation_observer);
@@ -125,7 +131,7 @@ void InkDropHighlight::AnimateFade(AnimationType animation_type,
if (initial_size != target_size) {
ui::LayerAnimationElement* transform_element =
ui::LayerAnimationElement::CreateTransformElement(
- CalculateTransform(target_size), duration);
+ CalculateTransform(target_size), effective_duration);
ui::LayerAnimationSequence* transform_sequence =
new ui::LayerAnimationSequence(transform_element);
transform_sequence->AddObserver(animation_observer);
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_ripple.cc ('k') | ui/views/animation/square_ink_drop_ripple.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698