File: tab_enums.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (102 lines) | stat: -rw-r--r-- 3,665 bytes parent folder | download | duplicates (5)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_TABS_TAB_ENUMS_H_
#define CHROME_BROWSER_UI_TABS_TAB_ENUMS_H_

// State indicating if the user is following the web feed of the site loaded in
// a tab.
enum class TabWebFeedFollowState {
  kUnknown,      // The initial state before the follow state is determined.
  kFollowed,     // The web feed is followed.
  kNotFollowed,  // The web feed is not followed.
};

// The Service, UI, or Setting which muted the tab.
enum class TabMutedReason {
  NONE,                    // The tab has never been muted or unmuted.
  EXTENSION,               // Mute state changed via extension API.
  AUDIO_INDICATOR,         // Mute toggled via tab-strip audio icon.
  CONTENT_SETTING,         // The sound content setting was set to BLOCK.
  CONTENT_SETTING_CHROME,  // Mute toggled on chrome:// URL.
};

// A BitField used to specify what should happen when the tab is closed.
enum TabCloseTypes {
  CLOSE_NONE = 0,

  // Indicates the tab was closed by the user. If true,
  // WebContents::SetClosedByUserGesture(true) is invoked.
  CLOSE_USER_GESTURE = 1 << 0,

  // If true the history is recorded so that the tab can be reopened later. You
  // almost always want to set this.
  CLOSE_CREATE_HISTORICAL_TAB = 1 << 1,

};

// Constants used when adding tabs.
enum AddTabTypes {
  // Used to indicate nothing special should happen to the newly inserted tab.
  ADD_NONE = 0,

  // The tab should be active.
  ADD_ACTIVE = 1 << 0,

  // The tab should be pinned.
  ADD_PINNED = 1 << 1,

  // If not set the insertion index of the WebContents is left up to the Order
  // Controller associated, so the final insertion index may differ from the
  // specified index. Otherwise the index supplied is used.
  ADD_FORCE_INDEX = 1 << 2,

  // If set the newly inserted tab's opener is set to the active tab. If not
  // set the tab may still inherit the opener under certain situations.
  ADD_INHERIT_OPENER = 1 << 3,
};

// Enumerates different ways to open a new tab. Does not apply to opening
// existing links or searches in a new tab, only to brand new empty tabs.
// KEEP IN SYNC WITH THE NewTabType ENUM IN enums.xml.
// NEW VALUES MUST BE APPENDED AND AVOID CHANGING ANY PRE-EXISTING VALUES.
enum NewTabTypes {
  // New tab was opened using the new tab button on the tab strip.
  NEW_TAB_BUTTON = 0,

  // New tab was opened using the menu command - either through the keyboard
  // shortcut, or by opening the menu and selecting the command. Applies to
  // both app menu and the menu bar's File menu (on platforms that have one).
  NEW_TAB_COMMAND = 1,

  // New tab was opened through the context menu on the tab strip.
  NEW_TAB_CONTEXT_MENU = 2,

  // New tab was opened through the new tab button in the toolbar for the
  // WebUI touch-optimized tab strip.
  NEW_TAB_BUTTON_IN_TOOLBAR_FOR_TOUCH = 3,

  // New tab was opened through the new tab button inside of the WebUI tab
  // strip.
  NEW_TAB_BUTTON_IN_WEBUI_TAB_STRIP = 4,

  // Number of enum entries, used for UMA histogram reporting macros.
  NEW_TAB_ENUM_COUNT = 5,
};

// Enumerates different types of tab activation. Mainly used for
// comparison between classic tab strip and WebUI tab strip.
// KEEP IN SYNC WITH THE TabActivationTypes ENUM IN enums.xml.
// NEW VALUES MUST BE APPENDED AND AVOID CHANGING ANY PRE-EXISTING VALUES.
enum class TabActivationTypes {
  // Switch to a tab.
  kTab = 0,

  // Open the context menu of a tab.
  kContextMenu = 1,

  kMaxValue = kContextMenu,
};

#endif  // CHROME_BROWSER_UI_TABS_TAB_ENUMS_H_