Index: ash/metrics/task_switch_metrics_recorder.h |
diff --git a/ash/metrics/task_switch_metrics_recorder.h b/ash/metrics/task_switch_metrics_recorder.h |
index b2103be01d7a27a036cec32b1feaf9123f57db25..5c4383ca924162abebab51ca5695198653032724 100644 |
--- a/ash/metrics/task_switch_metrics_recorder.h |
+++ b/ash/metrics/task_switch_metrics_recorder.h |
@@ -22,6 +22,9 @@ class ASH_EXPORT TaskSwitchMetricsRecorder { |
// Enumeration of the different user interfaces that could be the source of |
// a task switch. Note this is not necessarily comprehensive of all sources. |
enum TaskSwitchSource { |
+ // Task switches caused by any two sources in this enum. NOTE: This value |
+ // should NOT be used outside of this class. |
+ kAny, |
// Task switches from selecting items in the app list. |
kAppList, |
// Task switches caused by selecting a window from overview mode which is |
@@ -38,19 +41,29 @@ class ASH_EXPORT TaskSwitchMetricsRecorder { |
TaskSwitchMetricsRecorder(); |
virtual ~TaskSwitchMetricsRecorder(); |
- // Notifies |this| that a "navigate to" task switch has occurred. A |
- // "navigate to" operation is defined by a task switch where the specific task |
- // that becomes active is user-predictable (ie Alt+Tab accelerator, launching |
- // a new window via the shelf, etc). Contrast to a "navigate away" operation |
- // which is defined as a user interaction that navigates away from a specified |
- // task and the next task that becomes active is likely not user-predictable |
- // (ie. closing or minimizing a window, closing a tab, etc). |
+ // Notifies |this| that a "navigate to" task switch has occurred from the |
+ // specified |task_switch_source|. The metrics associated with |
+ // TaskSwitchSource::kAny source will be updated as well. |
+ // |
+ // NOTE: A |task_switch_source| value of TaskSwitchSource::kAny should not be |
+ // used and behavior is undefined if it is. |
+ // |
+ // A "navigate to" operation is defined by a task switch where the specific |
+ // task that becomes active is user-predictable (ie Alt+Tab accelerator, |
tdanderson
2015/06/04 21:59:39
micro-nit: ie -> e.g., here and at line 56.
|
+ // launching a new window via the shelf, etc). Contrast to a "navigate away" |
+ // operation which is defined as a user interaction that navigates away from a |
+ // specified task and the next task that becomes active is likely not |
+ // user-predictable (ie. closing or minimizing a window, closing a tab, etc). |
// |
// Will add an entry to |histogram_map_| when called for the first time for |
// each |task_switch_source| value. |
void OnTaskSwitch(TaskSwitchSource task_switch_source); |
private: |
+ // Internal implementation of OnTaskSwitch(TaskSwitchSource) that will accept |
+ // the TaskSwitchSource::kAny value. |
+ void OnTaskSwitchInternal(TaskSwitchSource task_switch_source); |
+ |
// Returns the TaskSwitchTimeTracker associated with the specified |
// |task_switch_source|. May return nullptr if mapping does not exist yet. |
TaskSwitchTimeTracker* FindTaskSwitchTimeTracker( |