Index: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
index 6ecb3f85a3dda3b64dbb9de29c28181dafda7696..e2d6cef60d46d20775c46ca4ef15664df9571339 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
@@ -84,6 +84,8 @@ import java.util.UUID; |
// Lazily created proxy observer for handling all Java-based WebContentsObservers. |
private WebContentsObserverProxy mObserverProxy; |
+ private boolean mContextMenuOpened; |
+ |
private WebContentsImpl( |
long nativeWebContentsAndroid, NavigationController navigationController) { |
mNativeWebContentsAndroid = nativeWebContentsAndroid; |
@@ -430,6 +432,24 @@ import java.util.UUID; |
srcRect.top, srcRect.left, srcRect.width(), srcRect.height()); |
} |
+ @Override |
+ public void onContextMenuOpened() { |
+ mContextMenuOpened = true; |
+ } |
+ |
+ @Override |
+ public void onContextMenuClosed() { |
+ if (!mContextMenuOpened) { |
+ return; |
+ } else { |
+ mContextMenuOpened = false; |
+ } |
+ |
+ if (mNativeWebContentsAndroid != 0) { |
+ nativeOnContextMenuClosed(mNativeWebContentsAndroid); |
+ } |
+ } |
+ |
@CalledByNative |
private void onGetContentBitmapFinished(ContentBitmapCallback callback, Bitmap bitmap, |
int response) { |
@@ -494,4 +514,5 @@ import java.util.UUID; |
private native void nativeGetContentBitmap(long nativeWebContentsAndroid, |
ContentBitmapCallback callback, Bitmap.Config config, float scale, |
float x, float y, float width, float height); |
+ private native void nativeOnContextMenuClosed(long nativeWebContentsAndroid); |
} |