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 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ |
7 | 7 |
8 #include <unordered_map> | |
9 | |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "content/browser/devtools/protocol/devtools_domain_handler.h" | 11 #include "content/browser/devtools/protocol/devtools_domain_handler.h" |
10 #include "content/browser/devtools/protocol/security.h" | 12 #include "content/browser/devtools/protocol/security.h" |
13 #include "content/public/browser/certificate_request_result_type.h" | |
11 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
12 | 15 |
13 namespace content { | 16 namespace content { |
14 | 17 |
15 class RenderFrameHostImpl; | 18 class RenderFrameHostImpl; |
16 | 19 |
17 namespace protocol { | 20 namespace protocol { |
18 | 21 |
19 class SecurityHandler : public DevToolsDomainHandler, | 22 class SecurityHandler : public DevToolsDomainHandler, |
20 public Security::Backend, | 23 public Security::Backend, |
21 public WebContentsObserver { | 24 public WebContentsObserver { |
22 public: | 25 public: |
23 SecurityHandler(); | 26 SecurityHandler(); |
24 ~SecurityHandler() override; | 27 ~SecurityHandler() override; |
25 | 28 |
26 void Wire(UberDispatcher* dispatcher) override; | 29 void Wire(UberDispatcher* dispatcher) override; |
27 void SetRenderFrameHost(RenderFrameHostImpl* host) override; | 30 void SetRenderFrameHost(RenderFrameHostImpl* host) override; |
28 | 31 |
29 Response Enable() override; | 32 Response Enable() override; |
30 Response Disable() override; | 33 Response Disable() override; |
31 Response ShowCertificateViewer() override; | 34 Response ShowCertificateViewer() override; |
35 Response HandleCertificateError(int, const String&) override; | |
Eric Seckler
2017/01/19 11:42:28
nit: int event_id, const String& action
(I think
irisu
2017/02/07 23:30:19
Done.
| |
32 | 36 |
33 private: | 37 private: |
34 void AttachToRenderFrameHost(); | 38 void AttachToRenderFrameHost(); |
35 | 39 |
40 using CertErrorHandlerMap = std::unordered_map<int, CertErrorHandler>; | |
41 | |
36 // WebContentsObserver overrides | 42 // WebContentsObserver overrides |
37 void DidChangeVisibleSecurityState() override; | 43 void DidChangeVisibleSecurityState() override; |
44 bool NotifyCertificateError(CertErrorHandler) override; | |
38 | 45 |
39 std::unique_ptr<Security::Frontend> frontend_; | 46 std::unique_ptr<Security::Frontend> frontend_; |
40 bool enabled_; | 47 bool enabled_; |
41 RenderFrameHostImpl* host_; | 48 RenderFrameHostImpl* host_; |
49 int cert_error_id_; | |
Eric Seckler
2017/01/19 11:42:28
nit: next_cert_error_id_
We should probably also
irisu
2017/02/07 23:30:19
Done.
| |
50 CertErrorHandlerMap handlers_; | |
42 | 51 |
43 DISALLOW_COPY_AND_ASSIGN(SecurityHandler); | 52 DISALLOW_COPY_AND_ASSIGN(SecurityHandler); |
44 }; | 53 }; |
45 | 54 |
46 } // namespace protocol | 55 } // namespace protocol |
47 } // namespace content | 56 } // namespace content |
48 | 57 |
49 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ | 58 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ |
OLD | NEW |