commit | 8e7c1213f30e0f24539704a0544ae79cb022288d | [log] [tgz] |
---|---|---|
author | Catherine Mullings <[email protected]> | Mon Oct 02 23:18:19 2017 |
committer | Commit Bot <[email protected]> | Mon Oct 02 23:18:19 2017 |
tree | e3be4cde5e56fdc19aad1bc4d423df8511d6278b | |
parent | bade1a6467e8d943f80650790e288959dbffae12 [diff] [blame] |
Extensions: Refactor use of range check of custom extension menu ids Refactor checks of whether a menu item id is an extension custom id or not. The static ContextMenuMatcher::IsExtensionsCustomCommandId() function is used instead. Bug: 765829 Change-Id: I2143e9449beb82a2e6580d82e86055b83c6ca41c Reviewed-on: https://chromium-review.googlesource.com/695718 Reviewed-by: Istiaque Ahmed <[email protected]> Commit-Queue: catmullings <[email protected]> Cr-Commit-Position: refs/heads/master@{#505844}
diff --git a/chrome/browser/extensions/context_menu_matcher.cc b/chrome/browser/extensions/context_menu_matcher.cc index a28c9f6b..e950cf6 100644 --- a/chrome/browser/extensions/context_menu_matcher.cc +++ b/chrome/browser/extensions/context_menu_matcher.cc
@@ -178,8 +178,7 @@ // top-level menu item is not added to the context menu, so checking its // visibility is a special case handled below. This top-level menu item should // always be displayed. - if (!item && command_id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST && - command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { + if (!item && ContextMenuMatcher::IsExtensionsCustomCommandId(command_id)) { return true; } else if (item) { return item->visible();