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

Unified Diff: chrome/browser/ui/android/page_info/connection_info_popup_android.cc

Issue 2567673002: Factor getCertificateChain out of ConnectionPopupInfo (Closed)
Patch Set: Address review comments Created 4 years 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 | « chrome/browser/ui/android/page_info/certificate_chain_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/page_info/connection_info_popup_android.cc
diff --git a/chrome/browser/ui/android/page_info/connection_info_popup_android.cc b/chrome/browser/ui/android/page_info/connection_info_popup_android.cc
index b7dc35713f0b665f36e002de62fa40ae73a5a966..c7254a258592e7c8df0c6c97af4ee3c45803a014 100644
--- a/chrome/browser/ui/android/page_info/connection_info_popup_android.cc
+++ b/chrome/browser/ui/android/page_info/connection_info_popup_android.cc
@@ -32,39 +32,6 @@ using base::android::JavaParamRef;
using base::android::ScopedJavaLocalRef;
using content::WebContents;
-static ScopedJavaLocalRef<jobjectArray> GetCertificateChain(
- JNIEnv* env,
- const JavaParamRef<jobject>& obj,
- const JavaParamRef<jobject>& java_web_contents) {
- content::WebContents* web_contents =
- content::WebContents::FromJavaWebContents(java_web_contents);
- if (!web_contents)
- return ScopedJavaLocalRef<jobjectArray>();
-
- scoped_refptr<net::X509Certificate> cert =
- web_contents->GetController().GetVisibleEntry()->GetSSL().certificate;
-
- std::vector<std::string> cert_chain;
- net::X509Certificate::OSCertHandles cert_handles =
- cert->GetIntermediateCertificates();
- // Make sure the peer's own cert is the first in the chain, if it's not
- // already there.
- if (cert_handles.empty() || cert_handles[0] != cert->os_cert_handle())
- cert_handles.insert(cert_handles.begin(), cert->os_cert_handle());
-
- cert_chain.reserve(cert_handles.size());
- for (net::X509Certificate::OSCertHandles::const_iterator it =
- cert_handles.begin();
- it != cert_handles.end();
- ++it) {
- std::string cert_bytes;
- net::X509Certificate::GetDEREncoded(*it, &cert_bytes);
- cert_chain.push_back(cert_bytes);
- }
-
- return base::android::ToJavaArrayOfByteArray(env, cert_chain);
-}
-
// static
static jlong Init(JNIEnv* env,
const JavaParamRef<jclass>& clazz,
« no previous file with comments | « chrome/browser/ui/android/page_info/certificate_chain_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698