shell_window_ids.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_CPP_SHELL_WINDOW_IDS_H_
  5. #define ASH_PUBLIC_CPP_SHELL_WINDOW_IDS_H_
  6. #include <vector>
  7. #include "ash/public/cpp/ash_public_export.h"
  8. // Declarations of ids of special shell windows.
  9. namespace ash {
  10. enum ShellWindowId {
  11. // Used to indicate no shell window id.
  12. kShellWindowId_Invalid = -1,
  13. // This container is used for animations which take a screenshot of the
  14. // contents, place them on top of the root and animate the screenshot layer.
  15. // We can't take a screenshot of the root itself, otherwise subsequent
  16. // screenshots will screenshot previous screenshots.
  17. kShellWindowId_ScreenAnimationContainer = 0,
  18. // The magnified container which contains everything that would be magnified
  19. // when docked magnifier is enabled.
  20. kShellWindowId_MagnifiedContainer,
  21. // The container for the Docked Magnifier viewport widget and the separator.
  22. kShellWindowId_DockedMagnifierContainer,
  23. // A higher-level container that holds all of the containers stacked below
  24. // kShellWindowId_LockScreenContainer. Only used by PowerButtonController for
  25. // animating lower-level containers and AccessibilityController for hiding
  26. // non-lock screen windows from Accessibility when the user session is
  27. // blocked.
  28. kShellWindowId_NonLockScreenContainersContainer,
  29. // A higher-level container that holds containers that hold lock-screen
  30. // windows. Only used by PowerButtonController for animating lower-level
  31. // containers.
  32. kShellWindowId_LockScreenContainersContainer,
  33. // A higher-level container that holds containers that hold
  34. // lock-screen-related windows (which are displayed regardless of the screen
  35. // lock state, effectively containers stacked above
  36. // kShellWindowId_LockSystemModalContainer). Used by the shelf, status area,
  37. // virtual keyboard, settings bubble, menus, etc. Also used by the
  38. // PowerButtonController for animating lower-level containers.
  39. kShellWindowId_LockScreenRelatedContainersContainer,
  40. // A container used for windows that temporarily have no parent. It is
  41. // expected the windows will get parented to another container shortly after.
  42. // This container is not visible.
  43. kShellWindowId_UnparentedContainer,
  44. // The wallpaper (desktop background) window.
  45. kShellWindowId_WallpaperContainer,
  46. // The glanceables ("welcome back") window container.
  47. kShellWindowId_GlanceablesContainer,
  48. // The containers for standard top-level windows per active desks.
  49. // * Notes:
  50. // - There are no direct mapping between `kShellWindowId_DeskContainerA` and
  51. // Desk 1, or `kShellWindowId_DeskContainerB` and Desk 2. The containers
  52. // are reused as desks are created and deleted.
  53. // - **DO NOT** use these container IDs directly, instead use
  54. // `desks_util::GetActiveDeskContainerId()`.
  55. // TODO(afakhry): Rename this container, unexpose it, and add the rest of the
  56. // containers.
  57. kShellWindowId_DefaultContainerDeprecated,
  58. kShellWindowId_DeskContainerB,
  59. kShellWindowId_DeskContainerC,
  60. kShellWindowId_DeskContainerD,
  61. kShellWindowId_DeskContainerE,
  62. kShellWindowId_DeskContainerF,
  63. kShellWindowId_DeskContainerG,
  64. kShellWindowId_DeskContainerH,
  65. // The container for top-level windows with the 'always-on-top' flag set.
  66. kShellWindowId_AlwaysOnTopContainer,
  67. // The container for the floating window.
  68. // Experimental feature, please don't use this container.
  69. kShellWindowId_FloatContainer,
  70. // The container for the app list.
  71. kShellWindowId_AppListContainer,
  72. // The container for the home screen, e.g. the app list in tablet mode.
  73. kShellWindowId_HomeScreenContainer,
  74. // The container for the PIP window.
  75. kShellWindowId_PipContainer,
  76. // The parent container that holds the ARC IME container and windows created
  77. // by ARC IME other than the virtual keyboard window.
  78. // This container window is to ensure that the ARC IME window is stacked above
  79. // top-level windows and the app list window but below the shelf.
  80. kShellWindowId_ArcImeWindowParentContainer,
  81. // The container for Virtual Keyboard from ARC IMEs.
  82. kShellWindowId_ArcVirtualKeyboardContainer,
  83. // The container for UI on the shelf (shelf, navigation, hotseat,
  84. // status area).
  85. kShellWindowId_ShelfContainer,
  86. // The container for bubbles which float over the shelf.
  87. kShellWindowId_ShelfBubbleContainer,
  88. // The container for user-specific modal windows.
  89. kShellWindowId_SystemModalContainer,
  90. // The container for the lock screen wallpaper (lock screen background).
  91. kShellWindowId_LockScreenWallpaperContainer,
  92. // The container for the lock screen.
  93. kShellWindowId_LockScreenContainer,
  94. // The container for windows that handle lock tray actions (e.g. new note
  95. // action). The action handler container's children should be visible on lock
  96. // screen, but only when an action is being handled - i.e. action handling
  97. // state is either:
  98. // * active - the container is stacked above LockScreenContainer
  99. // * background - the container is stacked below LockScreenContainer
  100. kShellWindowId_LockActionHandlerContainer,
  101. // The container for the lock screen modal windows.
  102. kShellWindowId_LockSystemModalContainer,
  103. // A parent container that holds the virtual keyboard container and ime
  104. // windows if any. This is to ensure that the virtual keyboard or ime window
  105. // is stacked above most containers but below the mouse cursor and the power
  106. // off animation.
  107. kShellWindowId_ImeWindowParentContainer,
  108. // The virtual keyboard container.
  109. kShellWindowId_VirtualKeyboardContainer,
  110. // The container for menus.
  111. kShellWindowId_MenuContainer,
  112. // The container for drag/drop images and tooltips.
  113. kShellWindowId_DragImageAndTooltipContainer,
  114. // The container for the fullscreen power button menu.
  115. kShellWindowId_PowerMenuContainer,
  116. // The container for bubbles briefly overlaid onscreen to show settings
  117. // changes (volume, brightness, input method bubbles, etc.).
  118. kShellWindowId_SettingBubbleContainer,
  119. // Contains special accessibility windows that can inset the display work area
  120. // (e.g. the ChromeVox spoken feedback window).
  121. // TODO(jamescook): Consolidate this with DockedMagnifierContainer.
  122. kShellWindowId_AccessibilityPanelContainer,
  123. // The container for accessibility bubbles that overlay the work area and any
  124. // other menus and bubbles, but appear under the Autoclick mouse UX in
  125. // kShellWindowId_OverlayContainer. Both Autoclick and Switch Access have
  126. // bubbles that appear in this layer. These features need to work with dialogs
  127. // and menus, so they must be shown above
  128. // kShellWindowId_SettingBubbleContainer to allow the user to access these
  129. // settings. However, these bubbles may have buttons with tooltips which must
  130. // be shown above the bubbles, so it must be under
  131. // kShellWindowId_DragImageAndTooltipContainer.
  132. // TODO(crbug/1076973): Investigate merging this container with
  133. // AccessibilityPanelContainer.
  134. kShellWindowId_AccessibilityBubbleContainer,
  135. // The container for special components overlaid onscreen, such as the
  136. // region selector for partial screenshots.
  137. kShellWindowId_OverlayContainer,
  138. // The container for ambient mode screen saver.
  139. kShellWindowId_AmbientModeContainer,
  140. // The container for mouse cursor.
  141. kShellWindowId_MouseCursorContainer,
  142. // The container for an image that should stay on top of everything except for
  143. // the power off animation.
  144. kShellWindowId_AlwaysOnTopWallpaperContainer,
  145. // The topmost container, used for power off animation.
  146. kShellWindowId_PowerButtonAnimationContainer,
  147. kShellWindowId_MinContainer = kShellWindowId_ScreenAnimationContainer,
  148. kShellWindowId_MaxContainer = kShellWindowId_PowerButtonAnimationContainer,
  149. };
  150. // Special shell windows that are not containers.
  151. enum NonContainerWindowId {
  152. // The window created by PhantomWindowController or DragWindowController.
  153. kShellWindowId_PhantomWindow = kShellWindowId_MaxContainer + 1,
  154. // The window that shows the Virtual Desks bar at the top of overview. There's
  155. // only one such window on each display when overview mode is active.
  156. kShellWindowId_DesksBarWindow,
  157. // The window that shows a blue highlight on the edges of a selected display.
  158. // Only one window exists whenever the display settings page is open with
  159. // multiple displays connected.
  160. kShellWindowId_DisplayIdentificationHighlightWindow,
  161. // The window specified as the owner of the folder selection menu for capture
  162. // mode, which will be a transient window parent of the about to be created
  163. // dialog window. This is needed in order to prevent
  164. // |SelectFileDialogExtension| from favoring to parent the dialog to a browser
  165. // window (if one exists).
  166. kShellWindowId_CaptureModeFolderSelectionDialogOwner,
  167. // The window that shows the "Save desk as template" button and `Save desk for
  168. // later` button below the Virtual Desks bar. There's only one such window on
  169. // each display when overview mode is active.
  170. kShellWindowId_SaveDeskButtonContainer,
  171. // The window that shows the Saved Desk Library in overview.
  172. kShellWindowId_SavedDeskLibraryWindow,
  173. // The window that shows the "No recent items" label in overview.
  174. kShellWindowId_OverviewNoWindowsLabelWindow,
  175. };
  176. // A list of system modal container IDs. The order of the list is important that
  177. // the more restrictive container appears before the less restrictive ones.
  178. constexpr int kSystemModalContainerIds[] = {
  179. kShellWindowId_LockSystemModalContainer,
  180. kShellWindowId_SystemModalContainer};
  181. // Returns the list of container ids of containers which may contain windows
  182. // that need to be activated. this list is ordered by the activation order; that
  183. // is, windows in containers appearing earlier in the list are activated before
  184. // windows in containers appearing later in the list. This list is used by
  185. // AshFocusRules to determine which container to start the search from when
  186. // looking for the next activatable window.
  187. ASH_PUBLIC_EXPORT std::vector<int> GetActivatableShellWindowIds();
  188. // Returns true if |id| is in GetActivatableShellWindowIds.
  189. ASH_PUBLIC_EXPORT bool IsActivatableShellWindowId(int id);
  190. } // namespace ash
  191. #endif // ASH_PUBLIC_CPP_SHELL_WINDOW_IDS_H_