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

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

Issue 2390793002: Removed Ash.AppList.TimeBetweenTaskSwitches and Ash.Tab.TimeBetweenSwitchToExistingTabUserActions h… (Closed)
Patch Set: Fixed up ash_unittests. Created 4 years, 2 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 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 9
10 namespace ash { 10 namespace ash {
11 11
12 namespace { 12 namespace {
13 13
14 const char kAshTaskSwitchHistogramName[] = "Ash.TimeBetweenTaskSwitches"; 14 const char kAshTaskSwitchHistogramName[] = "Ash.TimeBetweenTaskSwitches";
15 15
16 const char kDesktopHistogramName[] = 16 const char kDesktopHistogramName[] =
17 "Ash.Desktop.TimeBetweenNavigateToTaskSwitches"; 17 "Ash.Desktop.TimeBetweenNavigateToTaskSwitches";
18 18
19 const char kShelfHistogramName[] = 19 const char kShelfHistogramName[] =
20 "Ash.Shelf.TimeBetweenNavigateToTaskSwitches"; 20 "Ash.Shelf.TimeBetweenNavigateToTaskSwitches";
21 21
22 const char kTabStripHistogramName[] =
23 "Ash.Tab.TimeBetweenSwitchToExistingTabUserActions";
24
25 const char kAcceleratorWindowCycleHistogramName[] = 22 const char kAcceleratorWindowCycleHistogramName[] =
26 "Ash.WindowCycleController.TimeBetweenTaskSwitches"; 23 "Ash.WindowCycleController.TimeBetweenTaskSwitches";
27 24
28 const char kAppListHistogramName[] = "Ash.AppList.TimeBetweenTaskSwitches";
29
30 const char kOverviewModeHistogramName[] = 25 const char kOverviewModeHistogramName[] =
31 "Ash.WindowSelector.TimeBetweenActiveWindowChanges"; 26 "Ash.WindowSelector.TimeBetweenActiveWindowChanges";
32 27
33 // Returns the histogram name for the given |task_switch_source|. 28 // Returns the histogram name for the given |task_switch_source|.
34 const char* GetHistogramName(TaskSwitchSource task_switch_source) { 29 const char* GetHistogramName(TaskSwitchSource task_switch_source) {
35 switch (task_switch_source) { 30 switch (task_switch_source) {
36 case TaskSwitchSource::ANY: 31 case TaskSwitchSource::ANY:
37 return kAshTaskSwitchHistogramName; 32 return kAshTaskSwitchHistogramName;
38 case TaskSwitchSource::APP_LIST:
39 return kAppListHistogramName;
40 case TaskSwitchSource::DESKTOP: 33 case TaskSwitchSource::DESKTOP:
41 return kDesktopHistogramName; 34 return kDesktopHistogramName;
42 case TaskSwitchSource::OVERVIEW_MODE: 35 case TaskSwitchSource::OVERVIEW_MODE:
43 return kOverviewModeHistogramName; 36 return kOverviewModeHistogramName;
44 case TaskSwitchSource::SHELF: 37 case TaskSwitchSource::SHELF:
45 return kShelfHistogramName; 38 return kShelfHistogramName;
46 case TaskSwitchSource::TAB_STRIP:
47 return kTabStripHistogramName;
48 case TaskSwitchSource::WINDOW_CYCLE_CONTROLLER: 39 case TaskSwitchSource::WINDOW_CYCLE_CONTROLLER:
49 return kAcceleratorWindowCycleHistogramName; 40 return kAcceleratorWindowCycleHistogramName;
50 } 41 }
51 NOTREACHED(); 42 NOTREACHED();
52 return nullptr; 43 return nullptr;
53 } 44 }
54 45
55 } // namespace 46 } // namespace
56 47
57 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() {} 48 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() {}
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 histogram_map_.end()); 82 histogram_map_.end());
92 83
93 const char* histogram_name = GetHistogramName(task_switch_source); 84 const char* histogram_name = GetHistogramName(task_switch_source);
94 DCHECK(histogram_name); 85 DCHECK(histogram_name);
95 86
96 histogram_map_.add(static_cast<int>(task_switch_source), 87 histogram_map_.add(static_cast<int>(task_switch_source),
97 base::MakeUnique<TaskSwitchTimeTracker>(histogram_name)); 88 base::MakeUnique<TaskSwitchTimeTracker>(histogram_name));
98 } 89 }
99 90
100 } // namespace ash 91 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/metrics/task_switch_source.h ('k') | ash/metrics/task_switch_metrics_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698