@Override
 public MenuWrapper getMenu() {
   if (mMenu == null) {
     mMenu = new MenuWrapper(mActionMode.getMenu());
   }
   return mMenu;
 }
  /**
   * https://android.googlesource.com/platform/frameworks/base/+/cd92588/core/java/android/webkit/SelectActionModeCallback.java
   *
   * @param actionMode
   * @return ActionMode
   */
  @Override
  public ActionMode onWebViewStartActionMode(ActionMode actionMode) {
    Menu menu = actionMode.getMenu();

    for (int i = 0; i < menu.size(); i++) {
      MenuItem item = menu.getItem(i);
      item.setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
    }

    MenuInflater inflater = actionMode.getMenuInflater();
    inflater.inflate(R.menu.browser_action_mode, menu);
    translatePanelFragment.hide();

    menu.findItem(R.id.action_search)
        .setOnMenuItemClickListener(
            new MenuItem.OnMenuItemClickListener() {
              @Override
              public boolean onMenuItemClick(MenuItem menuItem) {
                startGettingSelectionInBrowser(JAVASCRIPT_CALLBACK_SEARCH);
                return false;
              }
            });
    menu.findItem(R.id.action_speech)
        .setOnMenuItemClickListener(
            new MenuItem.OnMenuItemClickListener() {
              @Override
              public boolean onMenuItemClick(MenuItem menuItem) {
                startGettingSelectionInBrowser(JAVASCRIPT_CALLBACK_SPEECH);
                return false;
              }
            });

    return actionMode;
  }
 public Menu getMenu() {
   return MenuWrapperFactory.createMenuWrapper(mWrappedObject.getMenu());
 }