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

Unified Diff: chrome/browser/ui/android/website_settings_popup_android.cc

Issue 22831005: Use visible entry for website settings dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TabSpecificContentSettings 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: chrome/browser/ui/android/website_settings_popup_android.cc
diff --git a/chrome/browser/ui/android/website_settings_popup_android.cc b/chrome/browser/ui/android/website_settings_popup_android.cc
index 4ae86b3ce1a4516cf6890c994028a65d51de7160..4d196b30e986c01c1cd585ddaab649875c8e3baa 100644
--- a/chrome/browser/ui/android/website_settings_popup_android.cc
+++ b/chrome/browser/ui/android/website_settings_popup_android.cc
@@ -36,7 +36,7 @@ static jobjectArray GetCertificateChain(JNIEnv* env,
content::WebContents* contents =
content::ContentViewCore::GetNativeContentViewCore(env, view)->
GetWebContents();
- int cert_id = contents->GetController().GetActiveEntry()->GetSSL().cert_id;
+ int cert_id = contents->GetController().GetVisibleEntry()->GetSSL().cert_id;
scoped_refptr<net::X509Certificate> cert;
bool ok = CertStore::GetInstance()->RetrieveCert(cert_id, &cert);
CHECK(ok);
@@ -77,7 +77,10 @@ WebsiteSettingsPopupAndroid::WebsiteSettingsPopupAndroid(
jobject context,
jobject java_content_view,
WebContents* web_contents) {
- if (web_contents->GetController().GetActiveEntry() == NULL)
+ // Important to use GetVisibleEntry to match what's showing in the omnibox.
+ content::NavigationEntry* nav_entry =
+ web_contents->GetController().GetVisibleEntry();
+ if (nav_entry == NULL)
return;
popup_jobject_.Reset(
@@ -89,8 +92,8 @@ WebsiteSettingsPopupAndroid::WebsiteSettingsPopupAndroid(
Profile::FromBrowserContext(web_contents->GetBrowserContext()),
TabSpecificContentSettings::FromWebContents(web_contents),
InfoBarService::FromWebContents(web_contents),
- web_contents->GetURL(),
- web_contents->GetController().GetActiveEntry()->GetSSL(),
+ nav_entry->GetURL(),
+ nav_entry->GetSSL(),
content::CertStore::GetInstance()));
}

Powered by Google App Engine
This is Rietveld 408576698