Commit d01aed9d authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

cros: Fix NOTREACHED on app custom menu

Extension/app custom menu range should be
  [IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST,
   IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST).

Bug: 837290
Test: Bring up context menu of "Files" and select "New Window".
Change-Id: Ifac2c6b23cde52618fcd0df27ccf11d5e4897547
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615385
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Auto-Submit: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660646}
parent a002a014
...@@ -282,8 +282,8 @@ bool IsCommandIdAnAppLaunch(int command_id_number) { ...@@ -282,8 +282,8 @@ bool IsCommandIdAnAppLaunch(int command_id_number) {
ash::CommandId command_id = static_cast<ash::CommandId>(command_id_number); ash::CommandId command_id = static_cast<ash::CommandId>(command_id_number);
// Consider all platform app menu options as launches. // Consider all platform app menu options as launches.
if (command_id >= ash::CommandId::USE_LAUNCH_TYPE_COMMAND_END && if (command_id >= ash::CommandId::EXTENSIONS_CONTEXT_CUSTOM_FIRST &&
command_id < ash::CommandId::LAUNCH_APP_SHORTCUT_FIRST) { command_id < ash::CommandId::EXTENSIONS_CONTEXT_CUSTOM_LAST) {
return true; return true;
} }
...@@ -332,6 +332,8 @@ bool IsCommandIdAnAppLaunch(int command_id_number) { ...@@ -332,6 +332,8 @@ bool IsCommandIdAnAppLaunch(int command_id_number) {
case ash::CommandId::USE_LAUNCH_TYPE_WINDOW: case ash::CommandId::USE_LAUNCH_TYPE_WINDOW:
case ash::CommandId::USE_LAUNCH_TYPE_COMMAND_END: case ash::CommandId::USE_LAUNCH_TYPE_COMMAND_END:
case ash::CommandId::STOP_APP: case ash::CommandId::STOP_APP:
case ash::CommandId::EXTENSIONS_CONTEXT_CUSTOM_FIRST:
case ash::CommandId::EXTENSIONS_CONTEXT_CUSTOM_LAST:
case ash::CommandId::COMMAND_ID_COUNT: case ash::CommandId::COMMAND_ID_COUNT:
return false; return false;
} }
......
...@@ -59,6 +59,14 @@ enum CommandId { ...@@ -59,6 +59,14 @@ enum CommandId {
// Command for stopping an app, or stopping a VM via an associated app. Used // Command for stopping an app, or stopping a VM via an associated app. Used
// by AppContextMenu and LauncherContextMenu. // by AppContextMenu and LauncherContextMenu.
STOP_APP = 2000, STOP_APP = 2000,
// Reserved range for extension/app custom menus as defined by
// IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST
// IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST
// in chrome/app/chrome_command_ids.h and used in ContextMenuMatcher.
EXTENSIONS_CONTEXT_CUSTOM_FIRST = 49000,
EXTENSIONS_CONTEXT_CUSTOM_LAST = 50000,
COMMAND_ID_COUNT COMMAND_ID_COUNT
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment