Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / extensions / api / debugger / debugger_api.h
blobaf2d98f1472288cbd9f89f987f05b4221d80c134
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Defines the Chrome Extensions Debugger API functions for attaching debugger
6 // to the page.
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_
9 #define CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_
11 #include <string>
12 #include <vector>
14 #include "chrome/browser/extensions/chrome_extension_function.h"
15 #include "chrome/common/extensions/api/debugger.h"
17 using extensions::api::debugger::Debuggee;
19 // Base debugger function.
21 class DevToolsTargetImpl;
23 namespace base {
24 class DictionaryValue;
27 namespace content {
28 class DevToolsAgentHost;
29 class WebContents;
32 namespace extensions {
33 class ExtensionDevToolsClientHost;
35 class DebuggerFunction : public ChromeAsyncExtensionFunction {
36 protected:
37 DebuggerFunction();
38 ~DebuggerFunction() override;
40 void FormatErrorMessage(const std::string& format);
42 bool InitAgentHost();
43 bool InitClientHost();
45 Debuggee debuggee_;
46 scoped_refptr<content::DevToolsAgentHost> agent_host_;
47 ExtensionDevToolsClientHost* client_host_;
50 // Implements the debugger.attach() extension function.
51 class DebuggerAttachFunction : public DebuggerFunction {
52 public:
53 DECLARE_EXTENSION_FUNCTION("debugger.attach", DEBUGGER_ATTACH)
55 DebuggerAttachFunction();
57 protected:
58 ~DebuggerAttachFunction() override;
60 // ExtensionFunction:
61 bool RunAsync() override;
64 // Implements the debugger.detach() extension function.
65 class DebuggerDetachFunction : public DebuggerFunction {
66 public:
67 DECLARE_EXTENSION_FUNCTION("debugger.detach", DEBUGGER_DETACH)
69 DebuggerDetachFunction();
71 protected:
72 ~DebuggerDetachFunction() override;
74 // ExtensionFunction:
75 bool RunAsync() override;
78 // Implements the debugger.sendCommand() extension function.
79 class DebuggerSendCommandFunction : public DebuggerFunction {
80 public:
81 DECLARE_EXTENSION_FUNCTION("debugger.sendCommand", DEBUGGER_SENDCOMMAND)
83 DebuggerSendCommandFunction();
84 void SendResponseBody(base::DictionaryValue* result);
86 protected:
87 ~DebuggerSendCommandFunction() override;
89 // ExtensionFunction:
90 bool RunAsync() override;
93 // Implements the debugger.getTargets() extension function.
94 class DebuggerGetTargetsFunction : public DebuggerFunction {
95 public:
96 DECLARE_EXTENSION_FUNCTION("debugger.getTargets", DEBUGGER_ATTACH)
98 DebuggerGetTargetsFunction();
100 protected:
101 ~DebuggerGetTargetsFunction() override;
103 // ExtensionFunction:
104 bool RunAsync() override;
106 private:
107 void SendTargetList(const std::vector<DevToolsTargetImpl*>& target_list);
110 } // namespace extensions
112 #endif // CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_