summaryrefslogtreecommitdiffstats
path: root/content/browser/android
diff options
context:
space:
mode:
authorcreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 03:29:02 +0000
committercreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 03:29:02 +0000
commit4252a15b70480f78d951f50d2699cd30e71c752b (patch)
treedda2ad5f2d800fcad6533a582c07fcdecdfb8f47 /content/browser/android
parent79b6066efef3091118f88a1c2bed093cbc830f3c (diff)
downloadchromium_src-4252a15b70480f78d951f50d2699cd30e71c752b.zip
chromium_src-4252a15b70480f78d951f50d2699cd30e71c752b.tar.gz
chromium_src-4252a15b70480f78d951f50d2699cd30e71c752b.tar.bz2
Allow showing pending URL for new tab navigations, but only if safe.
We revert to showing the opener's URL if it modifies the content of the initial blank page before the pending URL commits, to prevent URL spoofs. Implications: - All renderer-initiated navigations now have pending NavigationEntries. - GetURL and GetTitle use the visible entry, not active entry. - The renderer notifies the browser if DOM mutations occur before first load. BUG=9682 TEST=Open a slow link in a new tab. Destination URL should be visible and reloadable. Review URL: https://chromiumcodereview.appspot.com/12541018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191277 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/android')
-rw-r--r--content/browser/android/content_view_core_impl.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index ccdc2e0..81347ee 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -778,7 +778,12 @@ void ContentViewCoreImpl::SetAllUserAgentOverridesInHistory(
ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL(
JNIEnv* env, jobject) const {
- return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec());
+ // 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());
}
ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetTitle(