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

Side by Side Diff: ash/wm/overview/scoped_overview_animation_settings_aura.cc

Issue 2869263002: Add UMA for CrossFadeAnimation. (Closed)
Patch Set: Fix nits. Created 3 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « ash/rotator/screen_rotation_animator.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/overview/scoped_overview_animation_settings_aura.h" 5 #include "ash/wm/overview/scoped_overview_animation_settings_aura.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 case OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM: 47 case OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM:
48 return base::TimeDelta::FromMilliseconds(kCloseScaleMilliseconds); 48 return base::TimeDelta::FromMilliseconds(kCloseScaleMilliseconds);
49 case OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM: 49 case OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM:
50 return base::TimeDelta::FromMilliseconds(kCloseFadeOutMilliseconds); 50 return base::TimeDelta::FromMilliseconds(kCloseFadeOutMilliseconds);
51 } 51 }
52 NOTREACHED(); 52 NOTREACHED();
53 return base::TimeDelta(); 53 return base::TimeDelta();
54 } 54 }
55 55
56 class OverviewEnterMetricsReporter : public ui::AnimationMetricsReporter { 56 class OverviewEnterMetricsReporter : public ui::AnimationMetricsReporter {
57 public:
58 OverviewEnterMetricsReporter() = default;
59 ~OverviewEnterMetricsReporter() override = default;
60
57 void Report(int value) override { 61 void Report(int value) override {
58 UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Enter", 62 UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Enter",
59 value); 63 value);
60 } 64 }
65
66 private:
67 DISALLOW_COPY_AND_ASSIGN(OverviewEnterMetricsReporter);
61 }; 68 };
62 69
63 class OverviewExitMetricsReporter : public ui::AnimationMetricsReporter { 70 class OverviewExitMetricsReporter : public ui::AnimationMetricsReporter {
71 public:
72 OverviewExitMetricsReporter() = default;
73 ~OverviewExitMetricsReporter() override = default;
74
64 void Report(int value) override { 75 void Report(int value) override {
65 UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Exit", 76 UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Exit",
66 value); 77 value);
67 } 78 }
79
80 private:
81 DISALLOW_COPY_AND_ASSIGN(OverviewExitMetricsReporter);
68 }; 82 };
69 83
70 class OverviewCloseMetricsReporter : public ui::AnimationMetricsReporter { 84 class OverviewCloseMetricsReporter : public ui::AnimationMetricsReporter {
85 public:
86 OverviewCloseMetricsReporter() = default;
87 ~OverviewCloseMetricsReporter() override = default;
88
71 void Report(int value) override { 89 void Report(int value) override {
72 UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Close", 90 UMA_HISTOGRAM_PERCENTAGE("Ash.WindowSelector.AnimationSmoothness.Close",
73 value); 91 value);
74 } 92 }
93
94 private:
95 DISALLOW_COPY_AND_ASSIGN(OverviewCloseMetricsReporter);
75 }; 96 };
76 97
77 base::LazyInstance<OverviewEnterMetricsReporter>::Leaky g_reporter_enter = 98 base::LazyInstance<OverviewEnterMetricsReporter>::Leaky g_reporter_enter =
78 LAZY_INSTANCE_INITIALIZER; 99 LAZY_INSTANCE_INITIALIZER;
79 base::LazyInstance<OverviewExitMetricsReporter>::Leaky g_reporter_exit = 100 base::LazyInstance<OverviewExitMetricsReporter>::Leaky g_reporter_exit =
80 LAZY_INSTANCE_INITIALIZER; 101 LAZY_INSTANCE_INITIALIZER;
81 base::LazyInstance<OverviewCloseMetricsReporter>::Leaky g_reporter_close = 102 base::LazyInstance<OverviewCloseMetricsReporter>::Leaky g_reporter_close =
82 LAZY_INSTANCE_INITIALIZER; 103 LAZY_INSTANCE_INITIALIZER;
83 104
84 ui::AnimationMetricsReporter* GetMetricsReporter( 105 ui::AnimationMetricsReporter* GetMetricsReporter(
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 166 }
146 167
147 ScopedOverviewAnimationSettingsAura::~ScopedOverviewAnimationSettingsAura() {} 168 ScopedOverviewAnimationSettingsAura::~ScopedOverviewAnimationSettingsAura() {}
148 169
149 void ScopedOverviewAnimationSettingsAura::AddObserver( 170 void ScopedOverviewAnimationSettingsAura::AddObserver(
150 ui::ImplicitAnimationObserver* observer) { 171 ui::ImplicitAnimationObserver* observer) {
151 animation_settings_->AddObserver(observer); 172 animation_settings_->AddObserver(observer);
152 } 173 }
153 174
154 } // namespace ash 175 } // namespace ash
OLDNEW
« no previous file with comments | « ash/rotator/screen_rotation_animator.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698