summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelim Gurun <sgurun@google.com>2013-11-14 01:12:02 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-11-14 01:12:02 +0000
commit9f30eaedc3089bd173876e73524af2a6f95a6733 (patch)
treed39a6f7c0219ef51184942b7ea239c55b5b568a5
parent1fb9f596cd47b5e6e9abaaaadf2d1873be35cc02 (diff)
parente79e2fd309c0ca0a8248de4483024795f5bc5fdd (diff)
downloadchromium_org-9f30eaedc3089bd173876e73524af2a6f95a6733.tar.gz
Merge "Make sure to show the correct URL from CVC" into klp-dev
-rw-r--r--content/browser/android/content_view_core_impl.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index a28c2dc409..583cdfae37 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -841,12 +841,7 @@ 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();
- GURL url = entry ? entry->GetVirtualURL() : GURL::EmptyGURL();
- return ConvertUTF8ToJavaString(env, url.spec());
+ return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec());
}
ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetTitle(
@@ -1476,7 +1471,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());
@@ -1551,7 +1546,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();
}
@@ -1600,7 +1595,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;