Commit 983b73b1 authored by Owen Min's avatar Owen Min Committed by Commit Bot

Revert "Cros: Add metrics for transitions in the hotseat"

This reverts commit 9256783c.

Reason for revert: This CL may be responsible for multiple All/Overview* flaky use-of-uninitialized-value.

First failed build:
https://ci.chromium.org/p/chromium/builders/ci/Linux%20ChromiumOS%20MSan%20Tests/16416?blamelist=1#blamelist-tab

Because the original CL has been landed for few days, the change in
tools/metrics/histograms/histograms.xml are not reverted due to merge warning.

Original change's description:
> Cros: Add metrics for transitions in the hotseat
>
> Report animation smoothness for the transition into the hotseat in the
> HomeLauncher.
>
> Bug: 1022178, 1022177
> Change-Id: I5dc5e76688aa5a88bcabb5d688b419d819932867
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917941
> Commit-Queue: Ana Salazar <anasalazar@chromium.org>
> Reviewed-by: Alex Newcomer <newcomer@chromium.org>
> Reviewed-by: Manu Cornet <manucornet@chromium.org>
> Reviewed-by: Nik Bhagat <nikunjb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#718266}

TBR=nikunjb@chromium.org,newcomer@chromium.org,manucornet@chromium.org,anasalazar@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1022178, 1022177, 1028255
Change-Id: If460f00f10fb8f8df2a9f7d3d41abfdd91f0ad0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933739
Commit-Queue: Owen Min <zmin@chromium.org>
Reviewed-by: default avatarOwen Min <zmin@chromium.org>
Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718782}
parent d615c52c
......@@ -10,7 +10,6 @@
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "base/metrics/histogram_macros.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
......@@ -20,40 +19,8 @@
namespace ash {
class HotseatTransitionAnimator::TransitionAnimationMetricsReporter
: public ui::AnimationMetricsReporter {
public:
TransitionAnimationMetricsReporter() {}
~TransitionAnimationMetricsReporter() override = default;
void animating_to_shown_hotseat(bool animating_to_shown_hotseat) {
animating_to_shown_hotseat_ = animating_to_shown_hotseat;
}
// ui::AnimationMetricsReporter:
void Report(int value) override {
if (animating_to_shown_hotseat_) {
UMA_HISTOGRAM_PERCENTAGE(
"Ash.HotseatTransition.AnimationSmoothness.TransitionToShownHotseat",
value);
} else {
UMA_HISTOGRAM_PERCENTAGE(
"Ash.HotseatTransition.AnimationSmoothness."
"TransitionFromShownHotseat",
value);
}
}
private:
// Whether the animation reported is transitioning state into a shown hotseat.
bool animating_to_shown_hotseat_ = false;
};
HotseatTransitionAnimator::HotseatTransitionAnimator(ShelfWidget* shelf_widget)
: shelf_widget_(shelf_widget),
animation_metrics_reporter_(
std::make_unique<TransitionAnimationMetricsReporter>()) {
: shelf_widget_(shelf_widget) {
Shell::Get()->tablet_mode_controller()->AddObserver(this);
}
......@@ -153,8 +120,6 @@ void HotseatTransitionAnimator::SetAnimationStartProperties(
: shelf_widget_->hotseat_widget()
->GetOpaqueBackground()
->rounded_corner_radii());
animation_metrics_reporter_->animating_to_shown_hotseat(new_state ==
HotseatState::kShown);
}
void HotseatTransitionAnimator::StartAnimation(HotseatState old_state,
......@@ -167,8 +132,6 @@ void HotseatTransitionAnimator::StartAnimation(HotseatState old_state,
shelf_bg_animation_setter.SetTweenType(gfx::Tween::EASE_OUT);
shelf_bg_animation_setter.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
shelf_bg_animation_setter.SetAnimationMetricsReporter(
animation_metrics_reporter_.get());
animation_complete_callback_ = base::BindOnce(
&HotseatTransitionAnimator::NotifyHotseatTransitionAnimationEnded,
weak_ptr_factory_.GetWeakPtr(), old_state, new_state);
......
......@@ -49,8 +49,6 @@ class HotseatTransitionAnimator : public TabletModeObserver,
void OnTabletModeEnded() override;
private:
class TransitionAnimationMetricsReporter;
// Starts the animation between |old_state_| and |target_state_|.
void DoAnimation(HotseatState old_state, HotseatState new_state);
......@@ -81,10 +79,6 @@ class HotseatTransitionAnimator : public TabletModeObserver,
base::ObserverList<Observer> observers_;
// Metric reporter for hotseat transitions.
const std::unique_ptr<TransitionAnimationMetricsReporter>
animation_metrics_reporter_;
base::WeakPtrFactory<HotseatTransitionAnimator> weak_ptr_factory_{this};
};
......
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