| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Defines the Chrome Extensions Debugger API functions for attaching debugger | 5 // Defines the Chrome Extensions Debugger API functions for attaching debugger |
| 6 // to the page. | 6 // to the page. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ |
| 9 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "chrome/browser/extensions/extension_function.h" | 14 #include "chrome/browser/extensions/extension_function.h" |
| 15 | 15 |
| 16 // Base debugger function. | 16 // Base debugger function. |
| 17 | 17 |
| 18 class ExtensionDevToolsClientHost; | 18 class ExtensionDevToolsClientHost; |
| 19 class TabContents; | |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 class DictionaryValue; | 21 class DictionaryValue; |
| 23 } | 22 } |
| 24 | 23 |
| 24 namespace content { |
| 25 class WebContents; |
| 26 } |
| 27 |
| 25 class DebuggerFunction : public AsyncExtensionFunction { | 28 class DebuggerFunction : public AsyncExtensionFunction { |
| 26 protected: | 29 protected: |
| 27 DebuggerFunction(); | 30 DebuggerFunction(); |
| 28 virtual ~DebuggerFunction() {} | 31 virtual ~DebuggerFunction() {} |
| 29 | 32 |
| 30 bool InitTabContents(); | 33 bool InitTabContents(); |
| 31 bool InitClientHost(); | 34 bool InitClientHost(); |
| 32 | 35 |
| 33 TabContents* contents_; | 36 content::WebContents* contents_; |
| 34 int tab_id_; | 37 int tab_id_; |
| 35 ExtensionDevToolsClientHost* client_host_; | 38 ExtensionDevToolsClientHost* client_host_; |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 // Implements the debugger.attach() extension function. | 41 // Implements the debugger.attach() extension function. |
| 39 class AttachDebuggerFunction : public DebuggerFunction { | 42 class AttachDebuggerFunction : public DebuggerFunction { |
| 40 public: | 43 public: |
| 41 AttachDebuggerFunction(); | 44 AttachDebuggerFunction(); |
| 42 virtual ~AttachDebuggerFunction(); | 45 virtual ~AttachDebuggerFunction(); |
| 43 virtual bool RunImpl() OVERRIDE; | 46 virtual bool RunImpl() OVERRIDE; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 58 public: | 61 public: |
| 59 SendCommandDebuggerFunction(); | 62 SendCommandDebuggerFunction(); |
| 60 virtual ~SendCommandDebuggerFunction(); | 63 virtual ~SendCommandDebuggerFunction(); |
| 61 virtual bool RunImpl() OVERRIDE; | 64 virtual bool RunImpl() OVERRIDE; |
| 62 | 65 |
| 63 void SendResponseBody(base::DictionaryValue* dictionary); | 66 void SendResponseBody(base::DictionaryValue* dictionary); |
| 64 DECLARE_EXTENSION_FUNCTION_NAME("debugger.sendCommand") | 67 DECLARE_EXTENSION_FUNCTION_NAME("debugger.sendCommand") |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ | 70 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_H_ |
| OLD | NEW |