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 177ff0807c260b2cce2b3a90ca1229a5d35a2b1e..c1ee339fc7e9cc497389228bc087e3463fc3ed46 100644 |
--- a/ash/metrics/task_switch_metrics_recorder.h |
+++ b/ash/metrics/task_switch_metrics_recorder.h |
@@ -27,6 +27,9 @@ class ASH_EXPORT TaskSwitchMetricsRecorder { |
// a task switch. Note this is not necessarily comprehensive of all sources. |
// TODO(bruthig): Convert enum format from kValue to VALUE. |
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 the user activating a task window by clicking or |
@@ -46,19 +49,30 @@ 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 (e.g., 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 (e.g., 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( |