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

Side by Side Diff: ash/periodic_metrics_recorder.cc

Issue 26373009: ash:Shelf - Added UMA stats for ShelfAlignment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/periodic_metrics_recorder.h ('k') | ash/shelf/shelf_alignment_menu.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/periodic_metrics_recorder.h"
6
7 #include "ash/shelf/shelf_layout_manager.h"
8 #include "ash/shelf/shelf_view.h"
9 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shell.h"
11 #include "base/metrics/histogram.h"
12
13 namespace ash {
14
15 // Time in seconds between calls to "RecordMetrics".
16 const int kAshPeriodicMetricsTimeInSeconds = 30 * 60;
17
18 PeriodicMetricsRecorder::PeriodicMetricsRecorder() {
19 timer_.Start(FROM_HERE,
20 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds),
21 this,
22 &PeriodicMetricsRecorder::RecordMetrics);
23 }
24
25 PeriodicMetricsRecorder::~PeriodicMetricsRecorder() {
26 timer_.Stop();
27 }
28
29 void PeriodicMetricsRecorder::RecordMetrics() {
30 internal::ShelfLayoutManager* manager =
31 internal::ShelfLayoutManager::ForLauncher(Shell::GetPrimaryRootWindow());
32 if (manager) {
33 UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentOverTime",
34 manager->SelectValueForShelfAlignment(
35 internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM,
36 internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT,
37 internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT,
38 -1),
39 internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT);
40 }
41 }
42
43 } // namespace ash
OLDNEW
« no previous file with comments | « ash/periodic_metrics_recorder.h ('k') | ash/shelf/shelf_alignment_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698