Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4581)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java

Issue 381593002: Removing ContentView dependencies for few functions which acts as WebContents wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9e35fb2fa5b2c41423229e421507eb1cf9cf41e6..368221bdc8bb5804f784002eceb0224002679783 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
@@ -70,8 +70,89 @@ import org.chromium.content_public.browser.WebContents;
nativeInsertCSS(mNativeWebContentsAndroid, css);
}
+ @Override
+ public void onHide() {
+ nativeOnHide(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void onShow() {
+ nativeOnShow(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public int getBackgroundColor() {
+ return nativeGetBackgroundColor(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void addStyleSheetByURL(String url) {
+ nativeAddStyleSheetByURL(mNativeWebContentsAndroid, url);
+ }
+
+ @Override
+ public void showInterstitialPage(
+ String url, long interstitialPageDelegateAndroid) {
+ nativeShowInterstitialPage(mNativeWebContentsAndroid, url, interstitialPageDelegateAndroid);
+ }
+
+ @Override
+ public boolean isShowingInterstitialPage() {
+ return nativeIsShowingInterstitialPage(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public boolean isReady() {
+ return nativeIsRenderWidgetHostViewReady(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void exitFullscreen() {
+ nativeExitFullscreen(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void updateTopControlsState(boolean enableHiding, boolean enableShowing,
+ boolean animate) {
+ nativeUpdateTopControlsState(mNativeWebContentsAndroid, enableHiding,
+ enableShowing, animate);
+ }
+
+ @Override
+ public void showImeIfNeeded() {
+ nativeShowImeIfNeeded(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void scrollFocusedEditableNodeIntoView() {
+ // The native side keeps track of whether the zoom and scroll actually occurred. It is
+ // more efficient to do it this way and sometimes fire an unnecessary message rather
+ // than synchronize with the renderer and always have an additional message.
+ nativeScrollFocusedEditableNodeIntoView(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void selectWordAroundCaret() {
+ nativeSelectWordAroundCaret(mNativeWebContentsAndroid);
+ }
+
private native String nativeGetTitle(long nativeWebContentsAndroid);
private native String nativeGetVisibleURL(long nativeWebContentsAndroid);
private native void nativeStop(long nativeWebContentsAndroid);
private native void nativeInsertCSS(long nativeWebContentsAndroid, String css);
+ private native void nativeOnHide(long nativeWebContentsAndroid);
+ private native void nativeOnShow(long nativeWebContentsAndroid);
+ private native int nativeGetBackgroundColor(long nativeWebContentsAndroid);
+ private native void nativeAddStyleSheetByURL(long nativeWebContentsAndroid,
+ String url);
+ private native void nativeShowInterstitialPage(long nativeWebContentsAndroid,
+ String url, long nativeInterstitialPageDelegateAndroid);
+ private native boolean nativeIsShowingInterstitialPage(long nativeWebContentsAndroid);
+ private native boolean nativeIsRenderWidgetHostViewReady(long nativeWebContentsAndroid);
+ private native void nativeExitFullscreen(long nativeWebContentsAndroid);
+ private native void nativeUpdateTopControlsState(long nativeWebContentsAndroid,
+ boolean enableHiding, boolean enableShowing, boolean animate);
+ private native void nativeShowImeIfNeeded(long nativeWebContentsAndroid);
+ private native void nativeScrollFocusedEditableNodeIntoView(long nativeWebContentsAndroid);
+ private native void nativeSelectWordAroundCaret(long nativeWebContentsAndroid);
}

Powered by Google App Engine
This is Rietveld 408576698