| Index: content/shell/android/java/src/org/chromium/content_shell/Shell.java
|
| diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
|
| index 7cc7a7261b451bc2eb7201aa8705fc9cad7be227..d6ec45f5105f43486a5dd6c01213a19cb756ce27 100644
|
| --- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java
|
| +++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
|
| @@ -9,7 +9,10 @@ import android.content.Context;
|
| import android.graphics.drawable.ClipDrawable;
|
| import android.text.TextUtils;
|
| import android.util.AttributeSet;
|
| +import android.view.ActionMode;
|
| import android.view.KeyEvent;
|
| +import android.view.Menu;
|
| +import android.view.MenuItem;
|
| import android.view.View;
|
| import android.view.ViewGroup;
|
| import android.view.inputmethod.EditorInfo;
|
| @@ -23,12 +26,14 @@ import android.widget.TextView.OnEditorActionListener;
|
|
|
| import org.chromium.base.annotations.CalledByNative;
|
| import org.chromium.base.annotations.JNINamespace;
|
| +import org.chromium.content.browser.ActionModeCallbackHelper;
|
| import org.chromium.content.browser.ActivityContentVideoViewEmbedder;
|
| import org.chromium.content.browser.ContentVideoViewEmbedder;
|
| import org.chromium.content.browser.ContentView;
|
| import org.chromium.content.browser.ContentViewClient;
|
| import org.chromium.content.browser.ContentViewCore;
|
| import org.chromium.content.browser.ContentViewRenderView;
|
| +import org.chromium.content.browser.WebActionMode;
|
| import org.chromium.content_public.browser.LoadUrlParams;
|
| import org.chromium.content_public.browser.NavigationController;
|
| import org.chromium.content_public.browser.WebContents;
|
| @@ -293,7 +298,7 @@ public class Shell extends LinearLayout {
|
| mContentViewCore = new ContentViewCore(context, "");
|
| ContentView cv = ContentView.createContentView(context, mContentViewCore);
|
| mContentViewCore.initialize(ViewAndroidDelegate.createBasicDelegate(cv), cv,
|
| - webContents, mWindow);
|
| + webContents, mWindow, defaultActionCallback());
|
| mContentViewCore.setContentViewClient(mContentViewClient);
|
| mWebContents = mContentViewCore.getWebContents();
|
| mNavigationController = mWebContents.getNavigationController();
|
| @@ -309,6 +314,36 @@ public class Shell extends LinearLayout {
|
| mContentViewRenderView.setCurrentContentViewCore(mContentViewCore);
|
| }
|
|
|
| + /**
|
| + * Default {link @ActionMode.Callback} that uses the implementation in {@link WebActionMode}.
|
| + */
|
| + private ActionMode.Callback defaultActionCallback() {
|
| + final ActionModeCallbackHelper helper =
|
| + mContentViewCore.getActionModeCallbackHelper();
|
| +
|
| + return new ActionMode.Callback() {
|
| + @Override
|
| + public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
| + return helper.onCreateActionMode(mode, menu);
|
| + }
|
| +
|
| + @Override
|
| + public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
|
| + return helper.onPrepareActionMode(mode, menu);
|
| + }
|
| +
|
| + @Override
|
| + public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
| + return helper.onActionItemClicked(mode, item);
|
| + }
|
| +
|
| + @Override
|
| + public void onDestroyActionMode(ActionMode mode) {
|
| + helper.onDestroyActionMode();
|
| + }
|
| + };
|
| + }
|
| +
|
| @CalledByNative
|
| public ContentVideoViewEmbedder getContentVideoViewEmbedder() {
|
| return new ActivityContentVideoViewEmbedder((Activity) getContext()) {
|
|
|