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

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

Issue 1124153007: Added the Ash.Tab.TimeBetweenSwitchToExistingTabUserActions histogram to track time between tab swit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the branch that the diff was based on. 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 kTabStripHistogramName[] = "Tab.TimeBetweenTabSwitchToActions";
17
16 const char kAcceleratorWindowCycleHistogramName[] = 18 const char kAcceleratorWindowCycleHistogramName[] =
17 "Ash.WindowCycleController.TimeBetweenTaskSwitches"; 19 "Ash.WindowCycleController.TimeBetweenTaskSwitches";
18 20
19 // Returns the histogram name for the given |task_switch_source|. 21 // Returns the histogram name for the given |task_switch_source|.
20 const char* GetHistogramName( 22 const char* GetHistogramName(
21 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) { 23 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) {
22 switch (task_switch_source) { 24 switch (task_switch_source) {
23 case TaskSwitchMetricsRecorder::kShelf: 25 case TaskSwitchMetricsRecorder::kShelf:
24 return kShelfHistogramName; 26 return kShelfHistogramName;
27 case TaskSwitchMetricsRecorder::kTabStrip:
28 return kTabStripHistogramName;
25 case TaskSwitchMetricsRecorder::kWindowCycleController: 29 case TaskSwitchMetricsRecorder::kWindowCycleController:
26 return kAcceleratorWindowCycleHistogramName; 30 return kAcceleratorWindowCycleHistogramName;
27 } 31 }
28 NOTREACHED(); 32 NOTREACHED();
29 return nullptr; 33 return nullptr;
30 } 34 }
31 35
32 } // namespace 36 } // namespace
33 37
34 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() { 38 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() {
(...skipping 26 matching lines...) Expand all
61 65
62 const char* histogram_name = GetHistogramName(task_switch_source); 66 const char* histogram_name = GetHistogramName(task_switch_source);
63 DCHECK(histogram_name); 67 DCHECK(histogram_name);
64 68
65 histogram_map_.add( 69 histogram_map_.add(
66 task_switch_source, 70 task_switch_source,
67 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name))); 71 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name)));
68 } 72 }
69 73
70 } // namespace ash 74 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698