app_menu_constants.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Copyright 2018 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_APP_MENU_CONSTANTS_H_
  5. #define ASH_PUBLIC_CPP_APP_MENU_CONSTANTS_H_
  6. namespace ash {
  7. // Defines command ids used in Shelf and AppList app context menus. These are
  8. // used in histograms, do not remove/renumber entries. If you're adding to this
  9. // enum with the intention that it will be logged, add checks to ensure
  10. // stability of the enum and update the ChromeOSUICommands enum listing in
  11. // tools/metrics/histograms/enums.xml.
  12. enum CommandId {
  13. // Used by ShelfContextMenu.
  14. // Superseded by LAUNCH_NEW.
  15. DEPRECATED_MENU_OPEN_NEW = 0,
  16. MENU_CLOSE = 1,
  17. // Superseded by TOGGLE_PIN.
  18. DEPRECATED_MENU_PIN = 2,
  19. // Superseded by USE_LAUNCH_TYPE_PINNED.
  20. DEPRECATED_LAUNCH_TYPE_PINNED_TAB = 3,
  21. // Superseded by USE_LAUNCH_TYPE_REGULAR.
  22. DEPRECATED_LAUNCH_TYPE_REGULAR_TAB = 4,
  23. // Superseded by USE_LAUNCH_TYPE_FULLSCREEN.
  24. DEPRECATED_LAUNCH_TYPE_FULLSCREEN = 5,
  25. // Superseded by USE_LAUNCH_TYPE_WINDOW.
  26. DEPRECATED_LAUNCH_TYPE_WINDOW = 6,
  27. // Superseded by APP_CONTEXT_MENU_NEW_WINDOW.
  28. DEPRECATED_MENU_NEW_WINDOW = 7,
  29. // Superseded by APP_CONTEXT_MENU_NEW_INCOGNITO_WINDOW.
  30. DEPRECATED_MENU_NEW_INCOGNITO_WINDOW = 8,
  31. // Used by AppMenuModelAdapter.
  32. NOTIFICATION_CONTAINER = 9,
  33. // Used by CrostiniShelfContextMenu.
  34. CROSTINI_USE_LOW_DENSITY = 10,
  35. CROSTINI_USE_HIGH_DENSITY = 11,
  36. // Allow reordering of shelf items with the keyboard. Only used for shelf.
  37. SWAP_WITH_NEXT = 12,
  38. SWAP_WITH_PREVIOUS = 13,
  39. // Used by ShelfContextMenu.
  40. // Superseded by USE_LAUNCH_TYPE_TABBED_WINDOW.
  41. DEPRECATED_LAUNCH_TYPE_TABBED_WINDOW = 20,
  42. // Used by AppContextMenu and/or ShelfContextMenu.
  43. LAUNCH_NEW = 100,
  44. TOGGLE_PIN = 101,
  45. SHOW_APP_INFO = 102,
  46. OPTIONS = 103,
  47. UNINSTALL = 104,
  48. REMOVE_FROM_FOLDER = 105,
  49. APP_CONTEXT_MENU_NEW_WINDOW = 106,
  50. APP_CONTEXT_MENU_NEW_INCOGNITO_WINDOW = 107,
  51. INSTALL = 108,
  52. SETTINGS = 109,
  53. USE_LAUNCH_TYPE_COMMAND_START = 200,
  54. USE_LAUNCH_TYPE_PINNED = USE_LAUNCH_TYPE_COMMAND_START,
  55. USE_LAUNCH_TYPE_REGULAR = 201,
  56. USE_LAUNCH_TYPE_FULLSCREEN = 202,
  57. USE_LAUNCH_TYPE_WINDOW = 203,
  58. USE_LAUNCH_TYPE_TABBED_WINDOW = 204,
  59. USE_LAUNCH_TYPE_COMMAND_END,
  60. // The reorder options used by AppsGridContextMenu, ShelfContextMenuModel and
  61. // AppServiceContextMenu.
  62. REORDER_SUBMENU = 300,
  63. REORDER_BY_NAME_ALPHABETICAL = 301,
  64. REORDER_BY_NAME_REVERSE_ALPHABETICAL = 302,
  65. REORDER_BY_COLOR = 303,
  66. // Range of command ids reserved for launching app shortcuts from context
  67. // menu for Android app. Used by AppContextMenu and ShelfContextMenu.
  68. LAUNCH_APP_SHORTCUT_FIRST = 1000,
  69. LAUNCH_APP_SHORTCUT_LAST = 1999,
  70. // Command for shutting down a VM associated with an App. Used by
  71. // AppContextMenu and ShelfContextMenu.
  72. SHUTDOWN_GUEST_OS = 2000,
  73. // Range of command IDs reserved for shelf app menu items when there are
  74. // multiple instances of the same app.
  75. APP_MENU_ITEM_ID_FIRST = 3000,
  76. APP_MENU_ITEM_ID_LAST = 3999,
  77. // Reserved range for extension/app custom menus as defined by
  78. // IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST
  79. // IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST
  80. // in chrome/app/chrome_command_ids.h and used in ContextMenuMatcher.
  81. EXTENSIONS_CONTEXT_CUSTOM_FIRST = 49000,
  82. EXTENSIONS_CONTEXT_CUSTOM_LAST = 50000,
  83. COMMAND_ID_COUNT
  84. };
  85. // The size of app context menu items' icons.
  86. constexpr int kAppContextMenuIconSize = 20;
  87. // Minimum padding for children of NotificationMenuView in dips.
  88. constexpr int kNotificationHorizontalPadding = 16;
  89. constexpr int kNotificationVerticalPadding = 8;
  90. // Height of the NotificationItemView in dips.
  91. constexpr int kNotificationItemViewHeight = 48;
  92. // The maximum number of overflow icons which can be shown without the
  93. // showing |overflow_icon_|.
  94. constexpr int kMaxOverflowIcons = 9;
  95. // The identifier used for notifications in the NotificationOverflowView.
  96. constexpr int kNotificationOverflowIconId = 43;
  97. // The identifier used for the overflow icon in NotificationOverflowView.
  98. constexpr int kOverflowIconId = 44;
  99. } // namespace ash
  100. #endif // ASH_PUBLIC_CPP_APP_MENU_CONSTANTS_H_