| Index: ash/wm/overview/scoped_overview_animation_settings_aura.cc
|
| diff --git a/ash/wm/overview/scoped_overview_animation_settings_aura.cc b/ash/wm/overview/scoped_overview_animation_settings_aura.cc
|
| index d785c185dfe0f306f3abed9ed5c2c737a11a0cd6..9d5b117ab1821a299ce9d1633187a912ba8bbf81 100644
|
| --- a/ash/wm/overview/scoped_overview_animation_settings_aura.cc
|
| +++ b/ash/wm/overview/scoped_overview_animation_settings_aura.cc
|
| @@ -4,8 +4,10 @@
|
|
|
| #include "ash/wm/overview/scoped_overview_animation_settings_aura.h"
|
|
|
| +#include "base/lazy_instance.h"
|
| #include "base/time/time.h"
|
| #include "ui/aura/window.h"
|
| +#include "ui/compositor/animation_metrics_reporter_template.h"
|
| #include "ui/compositor/layer.h"
|
| #include "ui/compositor/layer_animation_observer.h"
|
| #include "ui/compositor/scoped_layer_animation_settings.h"
|
| @@ -51,6 +53,39 @@ base::TimeDelta GetAnimationDuration(OverviewAnimationType animation_type) {
|
| return base::TimeDelta();
|
| }
|
|
|
| +extern constexpr char kMetricCloseName[] =
|
| + "Ash.WindowSelector.AnimationSmoothness.Close";
|
| +extern constexpr char kMetricEnterName[] =
|
| + "Ash.WindowSelector.AnimationSmoothness.Enter";
|
| +extern constexpr char kMetricExitName[] =
|
| + "Ash.WindowSelector.AnimationSmoothness.Exit";
|
| +
|
| +base::LazyInstance<ui::AnimationMetricsReporterTemplate<kMetricCloseName>>::
|
| + Leaky g_reporter_close = LAZY_INSTANCE_INITIALIZER;
|
| +base::LazyInstance<ui::AnimationMetricsReporterTemplate<kMetricEnterName>>::
|
| + Leaky g_reporter_enter = LAZY_INSTANCE_INITIALIZER;
|
| +base::LazyInstance<ui::AnimationMetricsReporterTemplate<kMetricExitName>>::Leaky
|
| + g_reporter_exit = LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +ui::AnimationMetricsReporter* GetMetricsReporter(
|
| + OverviewAnimationType animation_type) {
|
| + switch (animation_type) {
|
| + case OVERVIEW_ANIMATION_NONE:
|
| + return nullptr;
|
| + case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN:
|
| + case OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS:
|
| + return g_reporter_enter.Pointer();
|
| + case OVERVIEW_ANIMATION_EXIT_OVERVIEW_MODE_FADE_OUT:
|
| + case OVERVIEW_ANIMATION_RESTORE_WINDOW:
|
| + return g_reporter_exit.Pointer();
|
| + case OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM:
|
| + case OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM:
|
| + return g_reporter_close.Pointer();
|
| + }
|
| + NOTREACHED();
|
| + return nullptr;
|
| +}
|
| +
|
| } // namespace
|
|
|
| ScopedOverviewAnimationSettingsAura::ScopedOverviewAnimationSettingsAura(
|
| @@ -91,6 +126,8 @@ ScopedOverviewAnimationSettingsAura::ScopedOverviewAnimationSettingsAura(
|
| }
|
| animation_settings_->SetTransitionDuration(
|
| GetAnimationDuration(animation_type));
|
| + animation_settings_->SetAnimationMetricsReporter(
|
| + GetMetricsReporter(animation_type));
|
| }
|
|
|
| ScopedOverviewAnimationSettingsAura::~ScopedOverviewAnimationSettingsAura() {}
|
|
|