OLD | NEW |
| (Empty) |
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. | |
4 | |
5 // Defines the Chrome Extensions Debugger API functions for attaching debugger | |
6 // to the page. | |
7 | |
8 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ | |
9 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ | |
10 #pragma once | |
11 | |
12 #include <string> | |
13 | |
14 #include "chrome/browser/extensions/extension_function.h" | |
15 | |
16 // Base debugger function. | |
17 | |
18 class ExtensionDevToolsClientHost; | |
19 | |
20 namespace base { | |
21 class DictionaryValue; | |
22 } | |
23 | |
24 namespace content { | |
25 class WebContents; | |
26 } | |
27 | |
28 class DebuggerFunction : public AsyncExtensionFunction { | |
29 protected: | |
30 DebuggerFunction(); | |
31 virtual ~DebuggerFunction() {} | |
32 | |
33 bool InitTabContents(); | |
34 bool InitClientHost(); | |
35 | |
36 content::WebContents* contents_; | |
37 int tab_id_; | |
38 ExtensionDevToolsClientHost* client_host_; | |
39 }; | |
40 | |
41 // Implements the debugger.attach() extension function. | |
42 class AttachDebuggerFunction : public DebuggerFunction { | |
43 public: | |
44 DECLARE_EXTENSION_FUNCTION_NAME("debugger.attach") | |
45 | |
46 AttachDebuggerFunction(); | |
47 | |
48 protected: | |
49 virtual ~AttachDebuggerFunction(); | |
50 | |
51 // ExtensionFunction: | |
52 virtual bool RunImpl() OVERRIDE; | |
53 }; | |
54 | |
55 // Implements the debugger.detach() extension function. | |
56 class DetachDebuggerFunction : public DebuggerFunction { | |
57 public: | |
58 DECLARE_EXTENSION_FUNCTION_NAME("debugger.detach") | |
59 | |
60 DetachDebuggerFunction(); | |
61 | |
62 protected: | |
63 virtual ~DetachDebuggerFunction(); | |
64 | |
65 // ExtensionFunction: | |
66 virtual bool RunImpl() OVERRIDE; | |
67 }; | |
68 | |
69 // Implements the debugger.sendCommand() extension function. | |
70 class SendCommandDebuggerFunction : public DebuggerFunction { | |
71 public: | |
72 DECLARE_EXTENSION_FUNCTION_NAME("debugger.sendCommand") | |
73 | |
74 SendCommandDebuggerFunction(); | |
75 void SendResponseBody(base::DictionaryValue* dictionary); | |
76 | |
77 protected: | |
78 virtual ~SendCommandDebuggerFunction(); | |
79 | |
80 // ExtensionFunction: | |
81 virtual bool RunImpl() OVERRIDE; | |
82 }; | |
83 | |
84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ | |
OLD | NEW |