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 669c896c35e3aa5153ea3e97e51164fa43f61fe3..e5f930cf9f96090a793762cac68f8910edb80244 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -817,10 +817,8 @@ jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) { |
ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( |
JNIEnv* env, jobject) const { |
- // 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(); |
GURL url = entry ? entry->GetVirtualURL() : GURL::EmptyGURL(); |
Charlie Reis
2013/09/16 23:10:54
These lines can be replaced with web_contents_->Ge
nasko
2013/09/18 17:03:18
Very good point!
|
return ConvertUTF8ToJavaString(env, url.spec()); |
} |
@@ -1426,7 +1424,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(); |
if (entry == NULL) |
return ScopedJavaLocalRef<jstring>(env, NULL); |
return ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec()); |
@@ -1501,7 +1499,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(); |
} |
@@ -1550,7 +1548,7 @@ void ContentViewCoreImpl::SetUseDesktopUserAgent( |
return; |
// Make sure the navigation entry actually exists. |
- NavigationEntry* entry = web_contents_->GetController().GetActiveEntry(); |
+ NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry(); |
if (!entry) |
return; |