Commit c2fecad5 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Giving two different kDefaultTransationDurationMs unique names

The animation code has two different
kDefaultTransationDurationMs depending on what code is used.
This caused issues with jumbo builds where one of them
shadowed the other one (scary). This renames them so that they
have unique names, and also moves them into the same scope to
keep things consistent.

Bug: 773275
Change-Id: I77b5ab72e48a9c967105d8eb0b2610cfbd6f0b40
Reviewed-on: https://chromium-review.googlesource.com/841063Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526028}
parent a8c58779
...@@ -39,7 +39,7 @@ namespace ui { ...@@ -39,7 +39,7 @@ namespace ui {
namespace { namespace {
const int kDefaultTransitionDurationMs = 120; const int kLayerAnimatorDefaultTransitionDurationMs = 120;
} // namespace } // namespace
...@@ -76,8 +76,8 @@ LayerAnimator* LayerAnimator::CreateDefaultAnimator() { ...@@ -76,8 +76,8 @@ LayerAnimator* LayerAnimator::CreateDefaultAnimator() {
// static // static
LayerAnimator* LayerAnimator::CreateImplicitAnimator() { LayerAnimator* LayerAnimator::CreateImplicitAnimator() {
return new LayerAnimator( return new LayerAnimator(base::TimeDelta::FromMilliseconds(
base::TimeDelta::FromMilliseconds(kDefaultTransitionDurationMs)); kLayerAnimatorDefaultTransitionDurationMs));
} }
// This macro provides the implementation for the setter and getter (well, // This macro provides the implementation for the setter and getter (well,
......
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
#include "ui/compositor/layer_animator.h" #include "ui/compositor/layer_animator.h"
#include "ui/compositor/layer_observer.h" #include "ui/compositor/layer_observer.h"
namespace ui {
namespace { namespace {
const int kDefaultTransitionDurationMs = 200; const int kScopedLayerAnimationDefaultTransitionDurationMs = 200;
template <typename Trait> template <typename Trait>
class ScopedLayerAnimationObserver : public ui::ImplicitAnimationObserver, class ScopedLayerAnimationObserver : public ui::ImplicitAnimationObserver,
...@@ -104,8 +106,6 @@ void AddScopedDeferredPaintingObserverRecursive( ...@@ -104,8 +106,6 @@ void AddScopedDeferredPaintingObserverRecursive(
} // namespace } // namespace
namespace ui {
// ScopedLayerAnimationSettings ------------------------------------------------ // ScopedLayerAnimationSettings ------------------------------------------------
ScopedLayerAnimationSettings::ScopedLayerAnimationSettings( ScopedLayerAnimationSettings::ScopedLayerAnimationSettings(
scoped_refptr<LayerAnimator> animator) scoped_refptr<LayerAnimator> animator)
...@@ -115,8 +115,8 @@ ScopedLayerAnimationSettings::ScopedLayerAnimationSettings( ...@@ -115,8 +115,8 @@ ScopedLayerAnimationSettings::ScopedLayerAnimationSettings(
old_transition_duration_(animator->GetTransitionDuration()), old_transition_duration_(animator->GetTransitionDuration()),
old_tween_type_(animator->tween_type()), old_tween_type_(animator->tween_type()),
old_preemption_strategy_(animator->preemption_strategy()) { old_preemption_strategy_(animator->preemption_strategy()) {
SetTransitionDuration( SetTransitionDuration(base::TimeDelta::FromMilliseconds(
base::TimeDelta::FromMilliseconds(kDefaultTransitionDurationMs)); kScopedLayerAnimationDefaultTransitionDurationMs));
} }
ScopedLayerAnimationSettings::~ScopedLayerAnimationSettings() { ScopedLayerAnimationSettings::~ScopedLayerAnimationSettings() {
......
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