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

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

Issue 414423002: Removing ContentViewCore dependencies from few functions which acts as direct wrapper to WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed setHasPendingNavigationTransitionForTesting from CVC. Created 6 years, 4 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 5caa21422090dda3c8d40ff1abb37c6dad6625c0..4b8f9cbb4a1d713df71d98143a3fd69165033d23 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
@@ -7,6 +7,7 @@ package org.chromium.content.browser.webcontents;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
import org.chromium.content_public.browser.NavigationController;
+import org.chromium.content_public.browser.NavigationTransitionDelegate;
import org.chromium.content_public.browser.WebContents;
/**
@@ -21,6 +22,8 @@ import org.chromium.content_public.browser.WebContents;
private long mNativeWebContentsAndroid;
private NavigationController mNavigationController;
+ private NavigationTransitionDelegate mNavigationTransitionDelegate = null;
+
private WebContentsImpl(
long nativeWebContentsAndroid, NavigationController navigationController) {
mNativeWebContentsAndroid = nativeWebContentsAndroid;
@@ -136,6 +139,75 @@ import org.chromium.content_public.browser.WebContents;
nativeSelectWordAroundCaret(mNativeWebContentsAndroid);
}
+ @Override
+ public String getUrl() {
+ return nativeGetURL(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public boolean isIncognito() {
+ return nativeIsIncognito(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void resumeResponseDeferredAtStart() {
+ nativeResumeResponseDeferredAtStart(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void setHasPendingNavigationTransitionForTesting() {
+ nativeSetHasPendingNavigationTransitionForTesting(mNativeWebContentsAndroid);
+ }
+
+ @Override
+ public void setNavigationTransitionDelegate(NavigationTransitionDelegate delegate) {
+ mNavigationTransitionDelegate = delegate;
+ }
+
+ /**
+ * Inserts the provided markup sandboxed into the frame.
+ */
+ public void setupTransitionView(String markup) {
+ nativeSetupTransitionView(mNativeWebContentsAndroid, markup);
+ }
+
+ /**
+ * Hides transition elements specified by the selector, and activates any
+ * exiting-transition stylesheets.
+ */
+ public void beginExitTransition(String cssSelector) {
+ nativeBeginExitTransition(mNativeWebContentsAndroid, cssSelector);
+ }
+
+ @CalledByNative
+ private void didDeferAfterResponseStarted(String markup, String cssSelector,
+ String enteringColor) {
+ if (mNavigationTransitionDelegate != null ) {
+ mNavigationTransitionDelegate.didDeferAfterResponseStarted(markup,
+ cssSelector, enteringColor);
+ }
+ }
+
+ @CalledByNative
+ private boolean willHandleDeferAfterResponseStarted() {
+ if (mNavigationTransitionDelegate == null) return false;
+ return mNavigationTransitionDelegate.willHandleDeferAfterResponseStarted();
+ }
+
+ @CalledByNative
+ private void addEnteringStylesheetToTransition(String stylesheet) {
+ if (mNavigationTransitionDelegate != null ) {
+ mNavigationTransitionDelegate.addEnteringStylesheetToTransition(stylesheet);
+ }
+ }
+
+ @CalledByNative
+ private void didStartNavigationTransitionForFrame(long frameId) {
+ if (mNavigationTransitionDelegate != null ) {
+ mNavigationTransitionDelegate.didStartNavigationTransitionForFrame(frameId);
+ }
+ }
+
private native String nativeGetTitle(long nativeWebContentsAndroid);
private native String nativeGetVisibleURL(long nativeWebContentsAndroid);
private native void nativeStop(long nativeWebContentsAndroid);
@@ -155,4 +227,13 @@ import org.chromium.content_public.browser.WebContents;
private native void nativeShowImeIfNeeded(long nativeWebContentsAndroid);
private native void nativeScrollFocusedEditableNodeIntoView(long nativeWebContentsAndroid);
private native void nativeSelectWordAroundCaret(long nativeWebContentsAndroid);
+ private native String nativeGetURL(long nativeWebContentsAndroid);
+ private native boolean nativeIsIncognito(long nativeWebContentsAndroid);
+ private native void nativeResumeResponseDeferredAtStart(long nativeWebContentsAndroid);
+ private native void nativeSetHasPendingNavigationTransitionForTesting(
+ long nativeWebContentsAndroid);
+ private native void nativeSetupTransitionView(long nativeWebContentsAndroid,
+ String markup);
+ private native void nativeBeginExitTransition(long nativeWebContentsAndroid,
+ String cssSelector);
}

Powered by Google App Engine
This is Rietveld 408576698