Index: content/browser/android/web_contents_observer_proxy.cc |
diff --git a/content/browser/android/web_contents_observer_proxy.cc b/content/browser/android/web_contents_observer_proxy.cc |
index e6a4c9dd69fe76a10ee805294bb50b2b84846257..cadc5ae4b32630d3e3e2e92e45fcf60024ca8ea6 100644 |
--- a/content/browser/android/web_contents_observer_proxy.cc |
+++ b/content/browser/android/web_contents_observer_proxy.cc |
@@ -81,17 +81,6 @@ void WebContentsObserverProxy::RenderProcessGone( |
Java_WebContentsObserverProxy_renderProcessGone(env, obj, was_oom_protected); |
} |
-void WebContentsObserverProxy::DidFinishNavigation( |
- NavigationHandle* navigation_handle) { |
- JNIEnv* env = AttachCurrentThread(); |
- ScopedJavaLocalRef<jobject> obj(java_observer_); |
- ScopedJavaLocalRef<jstring> jstring_url( |
- ConvertUTF8ToJavaString(env, web_contents()->GetVisibleURL().spec())); |
- Java_WebContentsObserverProxy_didFinishNavigation( |
- env, obj, navigation_handle->IsInMainFrame(), |
- navigation_handle->IsErrorPage(), navigation_handle->HasCommitted()); |
-} |
- |
void WebContentsObserverProxy::DidStartLoading() { |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jobject> obj(java_observer_); |
@@ -219,6 +208,37 @@ void WebContentsObserverProxy::DidCommitProvisionalLoadForFrame( |
!render_frame_host->GetParent(), jstring_url, transition_type); |
} |
+void WebContentsObserverProxy::DidStartNavigation( |
+ NavigationHandle* navigation_handle) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> obj(java_observer_); |
+ ScopedJavaLocalRef<jstring> jstring_url( |
+ ConvertUTF8ToJavaString(env, navigation_handle->GetURL().spec())); |
+ Java_WebContentsObserverProxy_didStartNavigation( |
+ env, obj, jstring_url, navigation_handle->IsInMainFrame(), |
+ navigation_handle->IsErrorPage()); |
+} |
+ |
+void WebContentsObserverProxy::DidFinishNavigation( |
+ NavigationHandle* navigation_handle) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> obj(java_observer_); |
+ ScopedJavaLocalRef<jstring> jstring_url( |
+ ConvertUTF8ToJavaString(env, navigation_handle->GetURL().spec())); |
+ jboolean is_reload = false; |
+ |
+ if (navigation_handle->HasCommitted()) { |
+ is_reload = ui::PageTransitionCoreTypeIs( |
Ted C
2017/01/06 21:50:59
pass the page transition type directly instead of
sky
2017/01/06 23:14:43
If we add INVALID it means all existing code would
|
+ navigation_handle->GetPageTransition(), ui::PAGE_TRANSITION_RELOAD); |
+ } |
+ |
+ Java_WebContentsObserverProxy_didFinishNavigation( |
+ env, obj, jstring_url, navigation_handle->IsInMainFrame(), |
+ navigation_handle->IsErrorPage(), navigation_handle->HasCommitted(), |
+ navigation_handle->IsSamePage(), is_reload, |
+ navigation_handle->GetNetErrorCode()); |
+} |
+ |
void WebContentsObserverProxy::DidFinishLoad(RenderFrameHost* render_frame_host, |
const GURL& validated_url) { |
JNIEnv* env = AttachCurrentThread(); |