diff --git a/cobalt/shell/android/java/src/dev/cobalt/shell/ContentViewRenderView.java b/cobalt/shell/android/java/src/dev/cobalt/shell/ContentViewRenderView.java index 60667cc77476..d0f2960375b1 100644 --- a/cobalt/shell/android/java/src/dev/cobalt/shell/ContentViewRenderView.java +++ b/cobalt/shell/android/java/src/dev/cobalt/shell/ContentViewRenderView.java @@ -134,18 +134,6 @@ protected void onWindowVisibilityChanged(int visibility) { } } - /** - * Sets the background color of the surface view. This method is necessary because the - * background color of ContentViewRenderView itself is covered by the background of - * SurfaceView. - * @param color The color of the background. - */ - public void setSurfaceViewBackgroundColor(int color) { - if (getSurfaceView() != null) { - getSurfaceView().setBackgroundColor(color); - } - } - /** * Gets the SurfaceView for this ContentViewRenderView */ @@ -195,13 +183,6 @@ protected SurfaceView createSurfaceView(Context context) { return new SurfaceView(context); } - /** - * @return whether the surface view is initialized and ready to render. - */ - public boolean isInitialized() { - return getSurfaceView().getHolder().getSurface() != null; - } - /** * Enter or leave overlay video mode. * @param enabled Whether overlay mode is enabled. diff --git a/cobalt/shell/android/java/src/dev/cobalt/shell/Shell.java b/cobalt/shell/android/java/src/dev/cobalt/shell/Shell.java index 6965b6942ac8..00f215f3531c 100644 --- a/cobalt/shell/android/java/src/dev/cobalt/shell/Shell.java +++ b/cobalt/shell/android/java/src/dev/cobalt/shell/Shell.java @@ -19,12 +19,7 @@ import android.app.Activity; import android.content.Context; -import android.graphics.Rect; import android.text.TextUtils; -import android.view.ActionMode; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import dev.cobalt.shell.ContentViewRenderView; @@ -33,13 +28,10 @@ import org.chromium.build.annotations.Initializer; import org.chromium.build.annotations.NullMarked; import org.chromium.build.annotations.Nullable; -import org.chromium.content_public.browser.ActionModeCallbackHelper; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.NavigationController; -import org.chromium.content_public.browser.SelectionPopupController; import org.chromium.content_public.browser.Visibility; import org.chromium.content_public.browser.WebContents; -import org.chromium.ui.base.ViewAndroidDelegate; import org.chromium.ui.base.WindowAndroid; import org.jni_zero.CalledByNative; import org.jni_zero.JNINamespace; @@ -61,14 +53,6 @@ public interface OnWebContentsReadyListener { } private static final String TAG = "cobalt"; - private static final long COMPLETED_PROGRESS_TIMEOUT_MS = 200; - - // Stylus handwriting: Setting this ime option instructs stylus writing service to restrict - // capturing writing events slightly outside the Url bar area. This is needed to prevent stylus - // handwriting in inputs in web content area that are very close to url bar area, from being - // committed to Url bar's Edit text. Ex: google.com search field. - private static final String IME_OPTION_RESTRICT_STYLUS_WRITING_AREA = - "restrictDirectWritingArea=true"; private WebContents mWebContents; private WebContents mSplashScreenWebContents; @@ -157,21 +141,6 @@ private void onNativeDestroyed() { mWebContents = null; } - /** - * @return Whether the Shell has been destroyed. - * @see #onNativeDestroyed() - */ - public boolean isDestroyed() { - return mNativeShell == 0; - } - - /** - * @return Whether or not the Shell is loading content. - */ - public boolean isLoading() { - return mLoading; - } - /** * Loads an URL. This will perform minimal amounts of sanitizing of the URL to attempt to * make it valid. @@ -219,10 +188,6 @@ private void setIsLoading(boolean loading) { mLoading = loading; } - public @Nullable ShellViewAndroidDelegate getViewAndroidDelegate() { - return mViewAndroidDelegate; - } - /** * Initializes the ContentView based on the native tab contents pointer passed in. * @param webContents A {@link WebContents} object. @@ -291,44 +256,6 @@ public void onActivityVisible(boolean visible) { } } - /** - * {link @ActionMode.Callback} that uses the default implementation in - * {@link SelectionPopupController}. - */ - private ActionMode.Callback2 defaultActionCallback() { - final ActionModeCallbackHelper helper = - SelectionPopupController.fromWebContents(mWebContents) - .getActionModeCallbackHelper(); - - return new ActionMode.Callback2() { - @Override - public boolean onCreateActionMode(ActionMode mode, Menu menu) { - helper.onCreateActionMode(mode, menu); - return true; - } - - @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(); - } - - @Override - public void onGetContentRect(ActionMode mode, View view, Rect outRect) { - helper.onGetContentRect(mode, view, outRect); - } - }; - } - @CalledByNative public void setOverlayMode(boolean useOverlayMode) { assumeNonNull(mContentViewRenderView).setOverlayVideoMode(useOverlayMode); @@ -351,14 +278,6 @@ public void setOverayModeChangedCallbackForTesting(Callback callback) { @CalledByNative private void enableUiControl(int controlId, boolean enabled) {} - /** - * @return The {@link View} currently shown by this Shell. - */ - public @Nullable View getContentView() { - ViewAndroidDelegate viewDelegate = mWebContents.getViewAndroidDelegate(); - return viewDelegate != null ? viewDelegate.getContainerView() : null; - } - /** * @return The {@link WebContents} currently managing the content shown by this Shell. */ diff --git a/cobalt/shell/android/java/src/dev/cobalt/shell/ShellManager.java b/cobalt/shell/android/java/src/dev/cobalt/shell/ShellManager.java index 05beeca64169..418332288aab 100644 --- a/cobalt/shell/android/java/src/dev/cobalt/shell/ShellManager.java +++ b/cobalt/shell/android/java/src/dev/cobalt/shell/ShellManager.java @@ -81,13 +81,6 @@ public void setWindow(WindowAndroid window) { mContentViewRenderView.onNativeLibraryLoaded(window); } - /** - * @return The window used to generate all shells. - */ - public WindowAndroid getWindow() { - return mWindow; - } - /** * Get the ContentViewRenderView. */ @@ -102,15 +95,6 @@ public WindowAndroid getWindow() { return mActiveShell; } - /** - * Creates a new shell pointing to the specified URL. - * @param url The URL the shell should load upon creation. - */ - public void launchShell(String url) { - // Calls the overloaded method with a null listener. - launchShell(url, /* deepLinkUrl= */ "", /* listener= */ null); - } - /** * Creates a new shell pointing to the specified URL. * @param url The URL the shell should load upon creation.