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

Unified Diff: content/browser/devtools/protocol/security_handler.cc

Issue 2327433002: Stop using CertStore which is not compatible with PlzNavigate. (Closed)
Patch Set: remove cert_store on ios Created 4 years, 3 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/devtools/protocol/security_handler.cc
diff --git a/content/browser/devtools/protocol/security_handler.cc b/content/browser/devtools/protocol/security_handler.cc
index f3a4f6e9775a91544bf323a7cc0253d62a8c940e..7414c3476950c815ed69f67353156d54c4fe04f2 100644
--- a/content/browser/devtools/protocol/security_handler.cc
+++ b/content/browser/devtools/protocol/security_handler.cc
@@ -7,9 +7,12 @@
#include <string>
#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
+#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/security_style_explanations.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/common/ssl_status.h"
namespace content {
namespace devtools {
@@ -44,11 +47,11 @@ void AddExplanations(
std::vector<scoped_refptr<SecurityStateExplanation>>* explanations) {
for (const auto& it : explanations_to_add) {
scoped_refptr<SecurityStateExplanation> explanation =
- SecurityStateExplanation::Create()->set_security_state(security_style)
- ->set_summary(it.summary)
- ->set_description(it.description);
- if (it.cert_id > 0)
- explanation->set_certificate_id(it.cert_id);
+ SecurityStateExplanation::Create()
+ ->set_security_state(security_style)
+ ->set_summary(it.summary)
+ ->set_description(it.description)
+ ->set_has_certificate(it.has_certificate);
explanations->push_back(explanation);
}
}
@@ -147,12 +150,14 @@ Response SecurityHandler::Disable() {
return Response::OK();
}
-Response SecurityHandler::ShowCertificateViewer(int certificate_id) {
+Response SecurityHandler::ShowCertificateViewer() {
if (!host_)
return Response::InternalError("Could not connect to view");
WebContents* web_contents = WebContents::FromRenderFrameHost(host_);
+ scoped_refptr<net::X509Certificate> certificate = web_contents->
+ GetController().GetLastCommittedEntry()->GetSSL().certificate;
web_contents->GetDelegate()->ShowCertificateViewerInDevTools(
- web_contents, certificate_id);
+ web_contents, certificate);
return Response::OK();
}
« no previous file with comments | « content/browser/devtools/protocol/security_handler.h ('k') | content/browser/frame_host/navigation_entry_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698