File: multitask_menu_metrics.h

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (83 lines) | stat: -rw-r--r-- 3,007 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_UI_FRAME_MULTITASK_MENU_MULTITASK_MENU_METRICS_H_
#define CHROMEOS_UI_FRAME_MULTITASK_MENU_MULTITASK_MENU_METRICS_H_

#include <string>

namespace chromeos {

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. Please keep in sync with
// MultitaskMenuEntryType in /src/tools/metrics/histograms/enums.xml.
enum class MultitaskMenuEntryType {
  kFrameSizeButtonHover = 0,
  kFrameSizeButtonLongPress = 1,
  kFrameSizeButtonLongTouch = 2,
  kGestureFling = 3,
  kGestureScroll = 4,
  kAccel = 5,
  kMaxValue = kAccel,
};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. Please keep in sync with
// MultitaskMenuActionType in /src/tools/metrics/histograms/enums.xml.
enum class MultitaskMenuActionType {
  kHalfSplitButton = 0,
  kFullscreenButton = 1,
  kPartialSplitButton = 2,
  kFloatButton = 3,
  kMaxValue = kFloatButton,
};

constexpr char kPartialSplitDurationHistogramName[] =
    "Ash.Window.PartialSplitDuration";

// Used to record when the user pressed the fullscreen option in the multitask
// menu.
constexpr char kFullscreenUserAction[] = "MultitaskMenu_Fullscreen";

// Used to record when the user pressed the exit fullscreen option in the
// multitask menu.
constexpr char kExitFullscreenUserAction[] = "MultitaskMenu_Exit_Fullscreen";

// Used to record when the user pressed the float option in the multitask menu.
constexpr char kFloatUserAction[] = "MultitaskMenu_Float";

// Used to record when the user pressed the unfloat option in the multitask
// menu.
constexpr char kUnFloatUserAction[] = "MultitaskMenu_UnFloat";

// Used to record when the user half splits to primary direction.
constexpr char kHalfSplitPrimaryUserAction[] =
    "MultitaskMenu_HalfSplit_Primary";

// Used to record when the user half splits to secondary direction.
constexpr char kHalfSplitSecondaryUserAction[] =
    "MultitaskMenu_HalfSplit_Secondary";

// Used to record when the user partial splits to one third.
constexpr char kPartialSplitOneThirdUserAction[] =
    "MultitaskMenu_PartialSplit_OneThird";

// Used to record when the user partial splits to two thirds.
constexpr char kPartialSplitTwoThirdsUserAction[] =
    "MultitaskMenu_PartialSplit_TwoThirds";

// Gets the proper histogram name based on whether the user is in tablet mode or
// not.
std::string GetEntryTypeHistogramName();
std::string GetActionTypeHistogramName();

// Records the method the user used to show the multitask menu.
void RecordMultitaskMenuEntryType(MultitaskMenuEntryType entry_type);

// Records the action the user took within the multitask menu.
void RecordMultitaskMenuActionType(MultitaskMenuActionType action_type);

}  // namespace chromeos

#endif  // CHROMEOS_UI_FRAME_MULTITASK_MENU_MULTITASK_MENU_METRICS_H_