Search in sources :

Example 21 with WebContents

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);
    }
}
Also used : WebContents(org.chromium.content_public.browser.WebContents) View(android.view.View) CalledByNative(org.chromium.base.annotations.CalledByNative)

Aggregations

WebContents (org.chromium.content_public.browser.WebContents)21 Tab (org.chromium.chrome.browser.tab.Tab)5 Activity (android.app.Activity)2 Intent (android.content.Intent)2 View (android.view.View)2 ContentViewCore (org.chromium.content.browser.ContentViewCore)2 PendingIntent (android.app.PendingIntent)1 Context (android.content.Context)1 Bitmap (android.graphics.Bitmap)1 Rect (android.graphics.Rect)1 Uri (android.net.Uri)1 CustomTabsIntent (android.support.customtabs.CustomTabsIntent)1 ViewGroup (android.view.ViewGroup)1 ListView (android.widget.ListView)1 CalledByNative (org.chromium.base.annotations.CalledByNative)1 ChromeActivity (org.chromium.chrome.browser.ChromeActivity)1 OverlayContentDelegate (org.chromium.chrome.browser.compositor.bottombar.OverlayContentDelegate)1 OverlayContentProgressObserver (org.chromium.chrome.browser.compositor.bottombar.OverlayContentProgressObserver)1 OverlayPanelContent (org.chromium.chrome.browser.compositor.bottombar.OverlayPanelContent)1 ContextualSearchIconSpriteControl (org.chromium.chrome.browser.compositor.bottombar.contextualsearch.ContextualSearchIconSpriteControl)1