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

Side by Side Diff: ash/metrics/task_switch_metrics_recorder.cc

Issue 1126333005: Added metrics to track the time between task switches done via Alt+Tab and Alt+Shift+Tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed kAcceleratorWindowCycle_histogram to kAcceleratorWindowCycleHistogramName. Created 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/metrics/task_switch_metrics_recorder.h" 5 #include "ash/metrics/task_switch_metrics_recorder.h"
6 6
7 #include "ash/metrics/task_switch_time_tracker.h" 7 #include "ash/metrics/task_switch_time_tracker.h"
8 8
9 namespace ash { 9 namespace ash {
10 10
11 namespace { 11 namespace {
12 12
13 const char kShelfHistogramName[] = 13 const char kShelfHistogramName[] =
14 "Ash.Shelf.TimeBetweenNavigateToTaskSwitches"; 14 "Ash.Shelf.TimeBetweenNavigateToTaskSwitches";
15 15
16 const char kAcceleratorWindowCycleHistogramName[] =
17 "Ash.WindowCycleController.TimeBetweenTaskSwitches";
18
16 // Returns the histogram name for the given |task_switch_source|. 19 // Returns the histogram name for the given |task_switch_source|.
17 const char* GetHistogramName( 20 const char* GetHistogramName(
18 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) { 21 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) {
19 switch (task_switch_source) { 22 switch (task_switch_source) {
20 case TaskSwitchMetricsRecorder::kShelf: 23 case TaskSwitchMetricsRecorder::kShelf:
21 return kShelfHistogramName; 24 return kShelfHistogramName;
25 case TaskSwitchMetricsRecorder::kWindowCycleController:
26 return kAcceleratorWindowCycleHistogramName;
22 } 27 }
23 NOTREACHED(); 28 NOTREACHED();
24 return nullptr; 29 return nullptr;
25 } 30 }
26 31
27 } // namespace 32 } // namespace
28 33
29 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() { 34 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() {
30 } 35 }
31 36
(...skipping 24 matching lines...) Expand all
56 61
57 const char* histogram_name = GetHistogramName(task_switch_source); 62 const char* histogram_name = GetHistogramName(task_switch_source);
58 DCHECK(histogram_name); 63 DCHECK(histogram_name);
59 64
60 histogram_map_.add( 65 histogram_map_.add(
61 task_switch_source, 66 task_switch_source,
62 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name))); 67 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name)));
63 } 68 }
64 69
65 } // namespace ash 70 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698