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

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

Issue 2160833002: Adds WmShell::RecordTaskSwitchMetric() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 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
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/metrics/task_switch_metrics_recorder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/common/metrics/task_switch_source.h"
12 #include "base/containers/scoped_ptr_hash_map.h" 13 #include "base/containers/scoped_ptr_hash_map.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 15
15 namespace aura {
16 class Window;
17 } // namespace aura
18
19 namespace ash { 16 namespace ash {
20 17
21 class TaskSwitchTimeTracker; 18 class TaskSwitchTimeTracker;
22 19
23 // The TaskSwitchMetricsRecorder class records UMA metrics related to task 20 // The TaskSwitchMetricsRecorder class records UMA metrics related to task
24 // switching. The main purpose of the TaskSwitchMetricsRecorder is to track time 21 // switching. The main purpose of the TaskSwitchMetricsRecorder is to track time
25 // deltas between task switches and record histograms of the deltas. 22 // deltas between task switches and record histograms of the deltas.
26 class ASH_EXPORT TaskSwitchMetricsRecorder { 23 class ASH_EXPORT TaskSwitchMetricsRecorder {
27 public: 24 public:
28 // Enumeration of the different user interfaces that could be the source of
29 // a task switch. Note this is not necessarily comprehensive of all sources.
30 enum TaskSwitchSource {
31 // Task switches caused by any two sources in this enum. NOTE: This value
32 // should NOT be used outside of this class.
33 ANY,
34 // Task switches from selecting items in the app list.
35 APP_LIST,
36 // Task switches caused by the user activating a task window by clicking or
37 // tapping on it.
38 DESKTOP,
39 // Task switches caused by selecting a window from overview mode which is
40 // different from the previously-active window.
41 OVERVIEW_MODE,
42 // All task switches caused by shelf buttons, not including sub-menus.
43 SHELF,
44 // All task switches caused by the tab strip.
45 TAB_STRIP,
46 // Task switches caused by the WindowCycleController (ie Alt+Tab).
47 WINDOW_CYCLE_CONTROLLER
48 };
49
50 TaskSwitchMetricsRecorder(); 25 TaskSwitchMetricsRecorder();
51 virtual ~TaskSwitchMetricsRecorder(); 26 virtual ~TaskSwitchMetricsRecorder();
52 27
53 // Notifies |this| that a "navigate to" task switch has occurred from the 28 // Notifies |this| that a "navigate to" task switch has occurred from the
54 // specified |task_switch_source|. The metrics associated with 29 // specified |task_switch_source|. The metrics associated with
55 // TaskSwitchSource::ANY source will be updated as well. 30 // TaskSwitchSource::ANY source will be updated as well.
56 // 31 //
57 // NOTE: A |task_switch_source| value of TaskSwitchSource::ANY should not be 32 // NOTE: A |task_switch_source| value of TaskSwitchSource::ANY should not be
58 // used and behavior is undefined if it is. 33 // used and behavior is undefined if it is.
59 // 34 //
(...skipping 29 matching lines...) Expand all
89 // TaskSwitchTimeTracker is needed for a given source. 64 // TaskSwitchTimeTracker is needed for a given source.
90 base::ScopedPtrHashMap<int, std::unique_ptr<TaskSwitchTimeTracker>> 65 base::ScopedPtrHashMap<int, std::unique_ptr<TaskSwitchTimeTracker>>
91 histogram_map_; 66 histogram_map_;
92 67
93 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder); 68 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder);
94 }; 69 };
95 70
96 } // namespace ash 71 } // namespace ash
97 72
98 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ 73 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_
OLDNEW
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/metrics/task_switch_metrics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698