| Index: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
|
| index 06be21a6e565cf8f26aef38d7237ea06c6c3dd04..e8e578523104e6abaca4902cd77ca9c9ca10297e 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
|
| @@ -17,6 +17,7 @@ import org.chromium.base.VisibleForTesting;
|
| import org.chromium.base.annotations.CalledByNative;
|
| import org.chromium.chrome.browser.share.ShareHelper;
|
| import org.chromium.content.browser.ContentViewCore;
|
| +import org.chromium.content_public.browser.WebContents;
|
| import org.chromium.ui.base.WindowAndroid;
|
|
|
| /**
|
| @@ -60,21 +61,26 @@ public class ContextMenuHelper implements OnCreateContextMenuListener, OnMenuIte
|
| * @param params The {@link ContextMenuParams} that indicate what menu items to show.
|
| */
|
| @CalledByNative
|
| - private void showContextMenu(ContentViewCore contentViewCore, ContextMenuParams params) {
|
| + private boolean showContextMenu(ContentViewCore contentViewCore, ContextMenuParams params) {
|
| final View view = contentViewCore.getContainerView();
|
|
|
| if (!shouldShowMenu(params)
|
| || view == null
|
| || view.getVisibility() != View.VISIBLE
|
| || view.getParent() == null) {
|
| - return;
|
| + return false;
|
| }
|
|
|
| mCurrentContextMenuParams = params;
|
|
|
| view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
|
| view.setOnCreateContextMenuListener(this);
|
| - view.showContextMenu();
|
| + if (view.showContextMenu()) {
|
| + WebContents webContents = contentViewCore.getWebContents();
|
| + if (webContents != null) webContents.onContextMenuOpened();
|
| + return true;
|
| + }
|
| + return false;
|
| }
|
|
|
| /**
|
|
|