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

Unified Diff: ash/common/metrics/user_metrics_action.h

Issue 2063333002: mash: Move all ash UMA metrics to //ash/common/metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/common/shelf/shelf_alignment_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/metrics/user_metrics_action.h
diff --git a/ash/metrics/user_metrics_recorder.h b/ash/common/metrics/user_metrics_action.h
similarity index 58%
copy from ash/metrics/user_metrics_recorder.h
copy to ash/common/metrics/user_metrics_action.h
index a482e43a5461242bcb6ce7fc1b9d535822f3f909..b53871053839ac1145cd0b09abf9b4a3c9bd2d9c 100644
--- a/ash/metrics/user_metrics_recorder.h
+++ b/ash/common/metrics/user_metrics_action.h
@@ -1,29 +1,13 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_METRICS_USER_METRICS_RECORDER_H_
-#define ASH_METRICS_USER_METRICS_RECORDER_H_
-
-#include <memory>
-
-#include "ash/ash_export.h"
-#include "ash/metrics/task_switch_metrics_recorder.h"
-#include "base/macros.h"
-#include "base/timer/timer.h"
+#ifndef ASH_COMMON_METRICS_USER_METRICS_ACTION_H_
+#define ASH_COMMON_METRICS_USER_METRICS_ACTION_H_
namespace ash {
-class DesktopTaskSwitchMetricRecorder;
-
-namespace test {
-class UserMetricsRecorderTestAPI;
-}
-
-namespace wm {
-enum class WmUserMetricsAction;
-}
-
+// Ash-owned user metrics.
enum UserMetricsAction {
UMA_ACCEL_EXIT_FIRST_Q,
UMA_ACCEL_EXIT_SECOND_Q,
@@ -37,6 +21,8 @@ enum UserMetricsAction {
UMA_ACCEL_SHUT_DOWN_POWER_BUTTON,
UMA_CLOSE_THROUGH_CONTEXT_MENU,
UMA_DESKTOP_SWITCH_TASK,
+ UMA_DRAG_MAXIMIZE_LEFT,
+ UMA_DRAG_MAXIMIZE_RIGHT,
UMA_LAUNCHER_BUTTON_PRESSED_WITH_MOUSE,
UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH,
UMA_LAUNCHER_CLICK_ON_APP,
@@ -50,6 +36,9 @@ enum UserMetricsAction {
UMA_MOUSE_DOWN,
UMA_PANEL_MINIMIZE_CAPTION_CLICK,
UMA_PANEL_MINIMIZE_CAPTION_GESTURE,
+ UMA_SHELF_ALIGNMENT_SET_BOTTOM,
+ UMA_SHELF_ALIGNMENT_SET_LEFT,
+ UMA_SHELF_ALIGNMENT_SET_RIGHT,
UMA_STATUS_AREA_AUDIO_CURRENT_INPUT_DEVICE,
UMA_STATUS_AREA_AUDIO_CURRENT_OUTPUT_DEVICE,
UMA_STATUS_AREA_AUDIO_SWITCH_INPUT_DEVICE,
@@ -111,7 +100,10 @@ enum UserMetricsAction {
UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK,
UMA_TOUCHPAD_GESTURE_OVERVIEW,
UMA_TOUCHSCREEN_TAP_DOWN,
+ UMA_TRAY_HELP,
+ UMA_TRAY_LOCK_SCREEN,
UMA_TRAY_OVERVIEW,
+ UMA_TRAY_SHUT_DOWN,
UMA_WINDOW_APP_CLOSE_BUTTON_CLICK,
UMA_WINDOW_CLOSE_BUTTON_CLICK,
UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN,
@@ -124,69 +116,18 @@ enum UserMetricsAction {
// Window selection started by beginning an alt+tab cycle. This does not count
// each step through an alt+tab cycle.
UMA_WINDOW_CYCLE,
-};
-
-// User Metrics Recorder provides a repeating callback (RecordPeriodicMetrics)
-// on a timer to allow recording of state data over time to the UMA records.
-// Any additional states (in ash) that require monitoring can be added to
-// this class. As well calls to record on action metrics
-// (RecordUserMetricsAction) are passed through the UserMetricsRecorder.
-class ASH_EXPORT UserMetricsRecorder {
- public:
- // Creates a UserMetricsRecorder that records metrics periodically. Equivalent
- // to calling UserMetricsRecorder(true).
- UserMetricsRecorder();
-
- virtual ~UserMetricsRecorder();
-
- // Records an Ash owned user action.
- void RecordUserMetricsAction(ash::UserMetricsAction action);
- void RecordUserMetricsAction(wm::WmUserMetricsAction action);
-
- TaskSwitchMetricsRecorder& task_switch_metrics_recorder() {
- return task_switch_metrics_recorder_;
- }
-
- // Informs |this| that the Shell has been initialized.
- void OnShellInitialized();
-
- // Informs |this| that the Shell is going to be shut down.
- void OnShellShuttingDown();
-
- private:
- friend class test::UserMetricsRecorderTestAPI;
-
- // Creates a UserMetricsRecorder and will only record periodic metrics if
- // |record_periodic_metrics| is true. This is used by tests that do not want
- // the timer to be started.
- // TODO(bruthig): Add a constructor that accepts a base::RepeatingTimer so
- // that tests can inject a test double that can be controlled by the test. The
- // missing piece is a suitable base::RepeatingTimer test double.
- explicit UserMetricsRecorder(bool record_periodic_metrics);
-
- // Records UMA metrics. Invoked periodically by the |timer_|.
- void RecordPeriodicMetrics();
-
- // Returns true if the user's session is active and they are in a desktop
- // environment.
- bool IsUserInActiveDesktopEnvironment() const;
-
- // Starts the |timer_| and binds it to |RecordPeriodicMetrics|.
- void StartTimer();
-
- // The periodic timer that triggers metrics to be recorded.
- base::RepeatingTimer timer_;
- TaskSwitchMetricsRecorder task_switch_metrics_recorder_;
+ // Thumbnail sized overview of windows triggered by pressing the overview key.
+ UMA_WINDOW_OVERVIEW,
- // Metric recorder to track how often task windows are activated by mouse
- // clicks or touchscreen taps.
- std::unique_ptr<DesktopTaskSwitchMetricRecorder>
- desktop_task_switch_metric_recorder_;
+ // User selected a window in overview mode different from the
+ // previously-active window.
+ UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED,
- DISALLOW_COPY_AND_ASSIGN(UserMetricsRecorder);
+ // Selecting a window in overview mode by pressing the enter key.
+ UMA_WINDOW_OVERVIEW_ENTER_KEY,
};
} // namespace ash
-#endif // ASH_METRICS_USER_METRICS_RECORDER_H_
+#endif // ASH_COMMON_METRICS_USER_METRICS_ACTION_H_
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/common/shelf/shelf_alignment_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698