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

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

Issue 1153633006: Added UMA statistics for changing the active window via click or touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the branch that the CL was based on. Created 5 years, 6 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 #ifndef ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ 5 #ifndef ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_
6 #define ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ 6 #define ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "base/containers/scoped_ptr_hash_map.h" 11 #include "base/containers/scoped_ptr_hash_map.h"
12 12
13 namespace aura {
14 class Window;
15 } // namespace aura
16
13 namespace ash { 17 namespace ash {
14 18
15 class TaskSwitchTimeTracker; 19 class TaskSwitchTimeTracker;
16 20
17 // The TaskSwitchMetricsRecorder class records UMA metrics related to task 21 // The TaskSwitchMetricsRecorder class records UMA metrics related to task
18 // switching. The main purpose of the TaskSwitchMetricsRecorder is to track time 22 // switching. The main purpose of the TaskSwitchMetricsRecorder is to track time
19 // deltas between task switches and record histograms of the deltas. 23 // deltas between task switches and record histograms of the deltas.
20 class ASH_EXPORT TaskSwitchMetricsRecorder { 24 class ASH_EXPORT TaskSwitchMetricsRecorder {
21 public: 25 public:
22 // Enumeration of the different user interfaces that could be the source of 26 // Enumeration of the different user interfaces that could be the source of
23 // a task switch. Note this is not necessarily comprehensive of all sources. 27 // a task switch. Note this is not necessarily comprehensive of all sources.
28 // TODO(bruthig): Convert enum format from kValue to VALUE.
24 enum TaskSwitchSource { 29 enum TaskSwitchSource {
25 // Task switches from selecting items in the app list. 30 // Task switches from selecting items in the app list.
26 kAppList, 31 kAppList,
32 // Task switches caused by the user activating a task window by clicking or
33 // tapping on it.
34 kDesktop,
27 // Task switches caused by selecting a window from overview mode which is 35 // Task switches caused by selecting a window from overview mode which is
28 // different from the previously-active window. 36 // different from the previously-active window.
29 kOverviewMode, 37 kOverviewMode,
30 // All task switches caused by shelf buttons, not including sub-menus. 38 // All task switches caused by shelf buttons, not including sub-menus.
31 kShelf, 39 kShelf,
32 // All task switches caused by the tab strip. 40 // All task switches caused by the tab strip.
33 kTabStrip, 41 kTabStrip,
34 // Task switches caused by the WindowCycleController (ie Alt+Tab). 42 // Task switches caused by the WindowCycleController (ie Alt+Tab).
35 kWindowCycleController 43 kWindowCycleController
36 }; 44 };
(...skipping 28 matching lines...) Expand all
65 // |histogram_map_| is populated on demand the first time a 73 // |histogram_map_| is populated on demand the first time a
66 // TaskSwitchTimeTracker is needed for a given source. 74 // TaskSwitchTimeTracker is needed for a given source.
67 base::ScopedPtrHashMap<int, scoped_ptr<TaskSwitchTimeTracker>> histogram_map_; 75 base::ScopedPtrHashMap<int, scoped_ptr<TaskSwitchTimeTracker>> histogram_map_;
68 76
69 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder); 77 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder);
70 }; 78 };
71 79
72 } // namespace ash 80 } // namespace ash
73 81
74 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ 82 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698