Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8644)

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 25674019: Make sure to show the correct URL from CVC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8de6d793a1a68c7dcaa323029462f6d831ee0cb1..93555d8bc0b6057b38ed15ce34b0aa32613386e7 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -822,12 +822,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(
@@ -1435,7 +1430,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());
@@ -1506,7 +1501,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();
}
@@ -1548,7 +1543,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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698