blob: d3d35de7416824114277a32bae4fafe0437c17c4 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2019 The Chromium Authors
Lorne Mitchelle300b6ba2019-10-07 19:48:352// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_
6#define CHROME_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_
7
Lorne Mitchelle300b6ba2019-10-07 19:48:358#include "chrome/browser/devtools/protocol/security.h"
9#include "content/public/browser/web_contents_observer.h"
10
11namespace content {
12class WebContents;
13} // namespace content
14
15class SecurityHandler : public protocol::Security::Backend,
16 public content::WebContentsObserver {
17 public:
18 SecurityHandler(content::WebContents* web_contents,
19 protocol::UberDispatcher* dispatcher);
Peter Boström53c6c5952021-09-17 09:41:2620
21 SecurityHandler(const SecurityHandler&) = delete;
22 SecurityHandler& operator=(const SecurityHandler&) = delete;
23
Lorne Mitchelle300b6ba2019-10-07 19:48:3524 ~SecurityHandler() override;
25
26 // Security::Backend:
27 protocol::Response Enable() override;
28 protocol::Response Disable() override;
29
30 private:
31 // WebContentsObserver overrides
32 void DidChangeVisibleSecurityState() override;
33
34 bool enabled_ = false;
35 std::unique_ptr<protocol::Security::Frontend> frontend_;
Lorne Mitchelle300b6ba2019-10-07 19:48:3536};
37
38#endif // CHROME_BROWSER_DEVTOOLS_PROTOCOL_SECURITY_HANDLER_H_