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); |
} |