| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/browser/devtools/protocol/devtools_domain_handler.h" | 9 #include "content/browser/devtools/protocol/devtools_domain_handler.h" |
| 10 #include "content/browser/devtools/protocol/security.h" | 10 #include "content/browser/devtools/protocol/security.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class DevToolsAgentHostImpl; |
| 15 class RenderFrameHostImpl; | 16 class RenderFrameHostImpl; |
| 16 | 17 |
| 17 namespace protocol { | 18 namespace protocol { |
| 18 | 19 |
| 19 class SecurityHandler : public DevToolsDomainHandler, | 20 class SecurityHandler : public DevToolsDomainHandler, |
| 20 public Security::Backend, | 21 public Security::Backend, |
| 21 public WebContentsObserver { | 22 public WebContentsObserver { |
| 22 public: | 23 public: |
| 23 SecurityHandler(); | 24 SecurityHandler(); |
| 24 ~SecurityHandler() override; | 25 ~SecurityHandler() override; |
| 25 | 26 |
| 26 void Wire(UberDispatcher* dispatcher) override; | 27 void Wire(UberDispatcher* dispatcher) override; |
| 27 void SetRenderFrameHost(RenderFrameHostImpl* host) override; | 28 void SetRenderFrameHost(RenderFrameHostImpl* host) override; |
| 28 | 29 |
| 30 static SecurityHandler* FromAgentHost(DevToolsAgentHostImpl* host); |
| 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; |
| 32 | 35 |
| 33 private: | 36 private: |
| 34 void AttachToRenderFrameHost(); | 37 void AttachToRenderFrameHost(); |
| 35 | 38 |
| 36 // WebContentsObserver overrides | 39 // WebContentsObserver overrides |
| 37 void DidChangeVisibleSecurityState() override; | 40 void DidChangeVisibleSecurityState() override; |
| 38 | 41 |
| 39 std::unique_ptr<Security::Frontend> frontend_; | 42 std::unique_ptr<Security::Frontend> frontend_; |
| 40 bool enabled_; | 43 bool enabled_; |
| 41 RenderFrameHostImpl* host_; | 44 RenderFrameHostImpl* host_; |
| 42 | 45 |
| 43 DISALLOW_COPY_AND_ASSIGN(SecurityHandler); | 46 DISALLOW_COPY_AND_ASSIGN(SecurityHandler); |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 } // namespace protocol | 49 } // namespace protocol |
| 47 } // namespace content | 50 } // namespace content |
| 48 | 51 |
| 49 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ | 52 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_ |
| OLD | NEW |