| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/devtools/protocol/security_handler.h" | 5 #include "content/browser/devtools/protocol/security_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "content/browser/devtools/devtools_session.h" | 9 #include "content/browser/devtools/devtools_session.h" |
| 10 #include "content/browser/frame_host/render_frame_host_impl.h" | 10 #include "content/browser/frame_host/render_frame_host_impl.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 .SetSummary(it.summary) | 51 .SetSummary(it.summary) |
| 52 .SetDescription(it.description) | 52 .SetDescription(it.description) |
| 53 .SetHasCertificate(it.has_certificate) | 53 .SetHasCertificate(it.has_certificate) |
| 54 .Build()); | 54 .Build()); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 // static | 60 // static |
| 61 SecurityHandler* SecurityHandler::FromAgentHost(DevToolsAgentHostImpl* host) { | 61 std::vector<SecurityHandler*> SecurityHandler::ForAgentHost( |
| 62 DevToolsSession* session = DevToolsDomainHandler::GetFirstSession(host); | 62 DevToolsAgentHostImpl* host) { |
| 63 if (!session) | 63 return DevToolsSession::HandlersForAgentHost<SecurityHandler>( |
| 64 return nullptr; | 64 host, Security::Metainfo::domainName); |
| 65 return static_cast<SecurityHandler*>( | |
| 66 session->GetHandlerByName(Security::Metainfo::domainName)); | |
| 67 } | 65 } |
| 68 | 66 |
| 69 SecurityHandler::SecurityHandler() | 67 SecurityHandler::SecurityHandler() |
| 70 : DevToolsDomainHandler(Security::Metainfo::domainName), | 68 : DevToolsDomainHandler(Security::Metainfo::domainName), |
| 71 enabled_(false), | 69 enabled_(false), |
| 72 host_(nullptr) { | 70 host_(nullptr) { |
| 73 } | 71 } |
| 74 | 72 |
| 75 SecurityHandler::~SecurityHandler() { | 73 SecurityHandler::~SecurityHandler() { |
| 76 } | 74 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 if (override && !enabled_) | 226 if (override && !enabled_) |
| 229 return Response::Error("Security domain not enabled"); | 227 return Response::Error("Security domain not enabled"); |
| 230 certificate_errors_overriden_ = override; | 228 certificate_errors_overriden_ = override; |
| 231 if (!override) | 229 if (!override) |
| 232 FlushPendingCertificateErrorNotifications(); | 230 FlushPendingCertificateErrorNotifications(); |
| 233 return Response::OK(); | 231 return Response::OK(); |
| 234 } | 232 } |
| 235 | 233 |
| 236 } // namespace protocol | 234 } // namespace protocol |
| 237 } // namespace content | 235 } // namespace content |
| OLD | NEW |