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

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

Issue 23022006: Remove GetActiveEntry usage from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
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;

Powered by Google App Engine
This is Rietveld 408576698