Chromium Code Reviews| Index: content/browser/android/content_view_core_impl.cc |
| diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
| index 80fe628dd022781a85a0bd56fe22b32d2d270490..43a892b3af567d7649ccf1a483fe5aacdad61335 100644 |
| --- a/content/browser/android/content_view_core_impl.cc |
| +++ b/content/browser/android/content_view_core_impl.cc |
| @@ -803,7 +803,7 @@ ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( |
| // The current users of the Java API expect to use the active entry |
| // rather than the visible entry, which is exposed by WebContents::GetURL. |
| content::NavigationEntry* entry = |
| - web_contents_->GetController().GetActiveEntry(); |
| + web_contents_->GetController().GetVisibleEntry(); |
|
Charlie Reis
2013/08/16 22:10:14
This goes against the comment, which Martin Kosiba
mkosiba (inactive)
2013/08/19 14:49:38
Hey! Thanks for remembering about this! We use a t
nasko
2013/09/12 17:56:31
Done.
|
| GURL url = entry ? entry->GetVirtualURL() : GURL::EmptyGURL(); |
| return ConvertUTF8ToJavaString(env, url.spec()); |
| } |
| @@ -1431,7 +1431,7 @@ void ContentViewCoreImpl::GetDirectedNavigationHistory(JNIEnv* env, |
| ScopedJavaLocalRef<jstring> |
| ContentViewCoreImpl::GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, |
| jobject obj) { |
| - NavigationEntry* entry = web_contents_->GetController().GetActiveEntry(); |
| + NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry(); |
|
mkosiba (inactive)
2013/08/19 14:49:38
@apiccion
FYI. This should be fine but just to be
nasko
2013/09/12 17:56:31
@mkosiba, @apiccion
What is the conclusion on this
|
| if (entry == NULL) |
| return ScopedJavaLocalRef<jstring>(env, NULL); |
| return ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec()); |
| @@ -1498,7 +1498,7 @@ void ContentViewCoreImpl::EvaluateJavaScript(JNIEnv* env, |
| bool ContentViewCoreImpl::GetUseDesktopUserAgent( |
| JNIEnv* env, jobject obj) { |
| - NavigationEntry* entry = web_contents_->GetController().GetActiveEntry(); |
| + NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry(); |
| return entry && entry->GetIsOverridingUserAgent(); |
| } |
| @@ -1547,7 +1547,7 @@ void ContentViewCoreImpl::SetUseDesktopUserAgent( |
| return; |
| // Make sure the navigation entry actually exists. |
| - NavigationEntry* entry = web_contents_->GetController().GetActiveEntry(); |
| + NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry(); |
|
mkosiba (inactive)
2013/08/19 14:49:38
@dfalcantara:
FYI. I think this should be fine for
gone
2013/08/19 18:40:39
Should be alright if the visible entry updates bef
nasko
2013/09/12 17:56:31
Done.
|
| if (!entry) |
| return; |