import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
+import org.chromium.base.ThreadUtils;
+import org.chromium.content_public.browser.WebContents;
/**
* This class receives callbacks that act as hooks for various a native web contents events related
public abstract class WebContentsObserverAndroid {
private long mNativeWebContentsObserverAndroid;
- public WebContentsObserverAndroid(ContentViewCore contentViewCore) {
- mNativeWebContentsObserverAndroid = nativeInit(contentViewCore.getNativeContentViewCore());
+ public WebContentsObserverAndroid(WebContents webContents) {
+ ThreadUtils.assertOnUiThread();
+ mNativeWebContentsObserverAndroid = nativeInit(webContents);
}
@CalledByNative
* @param url The validated url for the page.
* @param baseUrl The validated base url for the page.
* @param isNavigationToDifferentPage Whether the main frame navigated to a different page.
+ * @param isFragmentNavigation Whether the main frame navigation did not cause changes to the
+ * document (for example scrolling to a named anchor or PopState).
*/
@CalledByNative
public void didNavigateMainFrame(String url, String baseUrl,
- boolean isNavigationToDifferentPage) {
+ boolean isNavigationToDifferentPage, boolean isFragmentNavigation) {
+ }
+
+ /**
+ * Called when the page had painted something non-empty.
+ */
+ @CalledByNative
+ public void didFirstVisuallyNonEmptyPaint() {
}
/**
* @param isMainFrame Whether the load is happening for the main frame.
* @param url The committed URL being navigated to.
* @param transitionType The transition type as defined in
- * {@link org.chromium.content.browser.PageTransitionTypes} for the load.
+ * {@link org.chromium.ui.base.PageTransitionTypes} for the load.
*/
@CalledByNative
public void didCommitProvisionalLoadForFrame(
}
/**
- * Notifies that a navigation entry has been committed.
+ * Notifies that the document has finished loading for the given frame.
+ * @param frameId A positive, non-zero integer identifying the navigating frame.
*/
@CalledByNative
- public void navigationEntryCommitted() {
+ public void documentLoadedInFrame(long frameId) {
}
/**
- * Invoked when visible SSL state changes.
+ * Notifies that a navigation entry has been committed.
*/
@CalledByNative
- public void didChangeVisibleSSLState() {
+ public void navigationEntryCommitted() {
}
/**
}
/**
+ * Called when the theme color was changed.
+ * @param color the new color in ARGB format
+ */
+ @CalledByNative
+ public void didChangeThemeColor(int color) {
+ }
+
+ /**
* Destroy the corresponding native object.
*/
@CalledByNative
}
}
- private native long nativeInit(long contentViewCorePtr);
+ private native long nativeInit(WebContents webContents);
private native void nativeDestroy(long nativeWebContentsObserverAndroid);
}