| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_proxy.h" | 5 #include "content/browser/android/web_contents_observer_proxy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 replacements.ClearRef(); | 126 replacements.ClearRef(); |
| 127 bool urls_same_ignoring_fragment = | 127 bool urls_same_ignoring_fragment = |
| 128 params.url.ReplaceComponents(replacements) == | 128 params.url.ReplaceComponents(replacements) == |
| 129 details.previous_url.ReplaceComponents(replacements); | 129 details.previous_url.ReplaceComponents(replacements); |
| 130 | 130 |
| 131 // is_fragment_navigation is indicative of the intent of this variable. | 131 // is_fragment_navigation is indicative of the intent of this variable. |
| 132 // However, there isn't sufficient information here to determine whether this | 132 // However, there isn't sufficient information here to determine whether this |
| 133 // is actually a fragment navigation, or a history API navigation to a URL | 133 // is actually a fragment navigation, or a history API navigation to a URL |
| 134 // that would also be valid for a fragment navigation. | 134 // that would also be valid for a fragment navigation. |
| 135 bool is_fragment_navigation = | 135 bool is_fragment_navigation = |
| 136 urls_same_ignoring_fragment && | 136 urls_same_ignoring_fragment && details.is_in_page; |
| 137 (details.type == NAVIGATION_TYPE_IN_PAGE || details.is_in_page); | |
| 138 Java_WebContentsObserverProxy_didNavigateMainFrame( | 137 Java_WebContentsObserverProxy_didNavigateMainFrame( |
| 139 env, obj.obj(), jstring_url.obj(), jstring_base_url.obj(), | 138 env, obj.obj(), jstring_url.obj(), jstring_base_url.obj(), |
| 140 details.is_navigation_to_different_page(), is_fragment_navigation, | 139 details.is_navigation_to_different_page(), is_fragment_navigation, |
| 141 details.http_status_code); | 140 details.http_status_code); |
| 142 } | 141 } |
| 143 | 142 |
| 144 void WebContentsObserverProxy::DidNavigateAnyFrame( | 143 void WebContentsObserverProxy::DidNavigateAnyFrame( |
| 145 RenderFrameHost* render_frame_host, | 144 RenderFrameHost* render_frame_host, |
| 146 const LoadCommittedDetails& details, | 145 const LoadCommittedDetails& details, |
| 147 const FrameNavigateParams& params) { | 146 const FrameNavigateParams& params) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 ConvertUTF8ToJavaString(env, url.spec())); | 284 ConvertUTF8ToJavaString(env, url.spec())); |
| 286 | 285 |
| 287 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry( | 286 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry( |
| 288 env, obj.obj(), jstring_url.obj()); | 287 env, obj.obj(), jstring_url.obj()); |
| 289 } | 288 } |
| 290 | 289 |
| 291 bool RegisterWebContentsObserverProxy(JNIEnv* env) { | 290 bool RegisterWebContentsObserverProxy(JNIEnv* env) { |
| 292 return RegisterNativesImpl(env); | 291 return RegisterNativesImpl(env); |
| 293 } | 292 } |
| 294 } // namespace content | 293 } // namespace content |
| OLD | NEW |