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();