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

Unified Diff: content/browser/android/web_contents_observer_proxy.cc

Issue 2604543002: WebContentsObserver and TabObserver update for PlzNavigate (Closed)
Patch Set: nits Created 3 years, 11 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/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..bc068304e2716d0a6de2ce45d4bb99e0aab49275 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,33 @@ 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()));
+
+ Java_WebContentsObserverProxy_didFinishNavigation(
+ env, obj, jstring_url, navigation_handle->IsInMainFrame(),
+ navigation_handle->IsErrorPage(), navigation_handle->HasCommitted(),
+ navigation_handle->IsSamePage(),
+ navigation_handle->HasCommitted() ? navigation_handle->GetPageTransition()
+ : -1,
+ navigation_handle->GetNetErrorCode());
+}
+
void WebContentsObserverProxy::DidFinishLoad(RenderFrameHost* render_frame_host,
const GURL& validated_url) {
JNIEnv* env = AttachCurrentThread();

Powered by Google App Engine
This is Rietveld 408576698