| Index: android_webview/java/src/org/chromium/android_webview/AwWebContentsViewDelegate.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsViewDelegate.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsViewDelegate.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7775456ed3794db57810ff7f713cea426b6e9619
|
| --- /dev/null
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsViewDelegate.java
|
| @@ -0,0 +1,33 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.android_webview;
|
| +
|
| +import android.view.ViewGroup;
|
| +
|
| +import org.chromium.base.CalledByNative;
|
| +import org.chromium.base.JNINamespace;
|
| +
|
| +/**
|
| + * Java counter-part of AwWebContentsViewDelegate. Used only for handling
|
| + * context menu callback currently.
|
| + */
|
| +@JNINamespace("android_webview")
|
| +public class AwWebContentsViewDelegate {
|
| + private ViewGroup mContainerView;
|
| +
|
| + // Package private. Called by AwContents.
|
| + AwWebContentsViewDelegate(ViewGroup containerView) {
|
| + mContainerView = containerView;
|
| + }
|
| +
|
| + @CalledByNative
|
| + private void onShowContextMenu() {
|
| + // Context menu callback in Chromium is triggered by WebKit on an
|
| + // unhandled GestureLongPress event. Convert the context menu callback
|
| + // back into a long click event for Android WebView since the view
|
| + // system may choose to handle the gesture.
|
| + mContainerView.performLongClick();
|
| + }
|
| +}
|
|
|