OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/android/web_contents_observer_android.h" | 5 #include "content/browser/android/web_contents_observer_android.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include <jni.h> | 9 #include <jni.h> |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 details.previous_url.ReplaceComponents(replacements); | 143 details.previous_url.ReplaceComponents(replacements); |
144 | 144 |
145 // is_fragment_navigation is indicative of the intent of this variable. | 145 // is_fragment_navigation is indicative of the intent of this variable. |
146 // However, there isn't sufficient information here to determine whether this | 146 // However, there isn't sufficient information here to determine whether this |
147 // is actually a fragment navigation, or a history API navigation to a URL | 147 // is actually a fragment navigation, or a history API navigation to a URL |
148 // that would also be valid for a fragment navigation. | 148 // that would also be valid for a fragment navigation. |
149 bool is_fragment_navigation = urls_same_ignoring_fragment && | 149 bool is_fragment_navigation = urls_same_ignoring_fragment && |
150 (details.type == NAVIGATION_TYPE_IN_PAGE || details.is_in_page); | 150 (details.type == NAVIGATION_TYPE_IN_PAGE || details.is_in_page); |
151 Java_WebContentsObserverAndroid_didNavigateMainFrame( | 151 Java_WebContentsObserverAndroid_didNavigateMainFrame( |
152 env, obj.obj(), jstring_url.obj(), jstring_base_url.obj(), | 152 env, obj.obj(), jstring_url.obj(), jstring_base_url.obj(), |
153 details.is_navigation_to_different_page(), is_fragment_navigation); | 153 details.is_navigation_to_different_page(), is_fragment_navigation, |
| 154 details.http_status_code); |
154 } | 155 } |
155 | 156 |
156 void WebContentsObserverAndroid::DidNavigateAnyFrame( | 157 void WebContentsObserverAndroid::DidNavigateAnyFrame( |
157 RenderFrameHost* render_frame_host, | 158 RenderFrameHost* render_frame_host, |
158 const LoadCommittedDetails& details, | 159 const LoadCommittedDetails& details, |
159 const FrameNavigateParams& params) { | 160 const FrameNavigateParams& params) { |
160 JNIEnv* env = AttachCurrentThread(); | 161 JNIEnv* env = AttachCurrentThread(); |
161 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); | 162 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
162 if (obj.is_null()) | 163 if (obj.is_null()) |
163 return; | 164 return; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 if (obj.is_null()) | 316 if (obj.is_null()) |
316 return; | 317 return; |
317 Java_WebContentsObserverAndroid_didFirstVisuallyNonEmptyPaint( | 318 Java_WebContentsObserverAndroid_didFirstVisuallyNonEmptyPaint( |
318 env, obj.obj()); | 319 env, obj.obj()); |
319 } | 320 } |
320 | 321 |
321 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { | 322 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { |
322 return RegisterNativesImpl(env); | 323 return RegisterNativesImpl(env); |
323 } | 324 } |
324 } // namespace content | 325 } // namespace content |
OLD | NEW |