Chromium Code Reviews| 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..d887b3bc0537bc15ff0ce77ff73c3a4049eabf6b 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; |
| @@ -29,6 +32,7 @@ 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 +297,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.getActionMode())); |
|
boliu
2016/10/26 00:20:57
getActionModeDelegate (basically the interface ver
Jinsuk Kim
2016/10/26 06:11:39
Done.
|
| mContentViewCore.setContentViewClient(mContentViewClient); |
| mWebContents = mContentViewCore.getWebContents(); |
| mNavigationController = mWebContents.getNavigationController(); |
| @@ -309,6 +313,33 @@ public class Shell extends LinearLayout { |
| mContentViewRenderView.setCurrentContentViewCore(mContentViewCore); |
| } |
| + /** |
| + * Default {link @ActionMode.Callback} that uses the implementation in {@link WebActionMode}. |
| + */ |
| + private static ActionMode.Callback defaultActionCallback(final WebActionMode actionMode) { |
| + return new ActionMode.Callback() { |
| + @Override |
| + public boolean onCreateActionMode(ActionMode mode, Menu menu) { |
| + return actionMode.onCreateActionMode(mode, menu); |
| + } |
| + |
| + @Override |
| + public boolean onPrepareActionMode(ActionMode mode, Menu menu) { |
| + return actionMode.onPrepareActionMode(mode, menu); |
| + } |
| + |
| + @Override |
| + public boolean onActionItemClicked(ActionMode mode, MenuItem item) { |
| + return actionMode.onActionItemClicked(mode, item); |
| + } |
| + |
| + @Override |
| + public void onDestroyActionMode(ActionMode mode) { |
| + actionMode.onDestroyActionMode(); |
| + } |
| + }; |
| + } |
| + |
| @CalledByNative |
| public ContentVideoViewEmbedder getContentVideoViewEmbedder() { |
| return new ActivityContentVideoViewEmbedder((Activity) getContext()) { |