use of org.chromium.content_public.browser.WebContents in project AndroidChromium by JackyAndroid.
the class ContextMenuHelper method showContextMenu.
/**
* Starts showing a context menu for {@code view} based on {@code params}.
* @param contentViewCore The {@link ContentViewCore} to show the menu to.
* @param params The {@link ContextMenuParams} that indicate what menu items to show.
*/
@CalledByNative
private void showContextMenu(ContentViewCore contentViewCore, ContextMenuParams params) {
final View view = contentViewCore.getContainerView();
if (view == null || view.getVisibility() != View.VISIBLE || view.getParent() == null) {
return;
}
mCurrentContextMenuParams = params;
view.setOnCreateContextMenuListener(this);
if (view.showContextMenu()) {
WebContents webContents = contentViewCore.getWebContents();
RecordHistogram.recordBooleanHistogram("ContextMenu.Shown", webContents != null);
}
}
Aggregations