| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_API_DEBUGGER_DEBUGGER_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ |
| 9 #define CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "chrome/browser/extensions/extension_function.h" | 13 #include "chrome/browser/extensions/extension_function.h" |
| 14 #include "chrome/common/extensions/api/debugger.h" |
| 15 |
| 16 using extensions::api::debugger::Debuggee; |
| 14 | 17 |
| 15 // Base debugger function. | 18 // Base debugger function. |
| 16 | 19 |
| 17 class ExtensionDevToolsClientHost; | 20 class ExtensionDevToolsClientHost; |
| 18 | 21 |
| 19 namespace base { | 22 namespace base { |
| 20 class DictionaryValue; | 23 class DictionaryValue; |
| 21 } | 24 } |
| 22 | 25 |
| 23 namespace content { | 26 namespace content { |
| 24 class DevToolsClientHost; | 27 class DevToolsClientHost; |
| 25 class WebContents; | 28 class WebContents; |
| 26 } | 29 } |
| 27 | 30 |
| 28 class DebuggerFunction : public AsyncExtensionFunction { | 31 class DebuggerFunction : public AsyncExtensionFunction { |
| 29 protected: | 32 protected: |
| 30 DebuggerFunction(); | 33 DebuggerFunction(); |
| 31 virtual ~DebuggerFunction() {} | 34 virtual ~DebuggerFunction() {} |
| 32 | 35 |
| 36 void FormatErrorMessage(const std::string& format); |
| 37 |
| 33 bool InitWebContents(); | 38 bool InitWebContents(); |
| 34 bool InitClientHost(); | 39 bool InitClientHost(); |
| 35 | 40 |
| 36 content::WebContents* contents_; | 41 content::WebContents* contents_; |
| 37 int tab_id_; | 42 Debuggee debuggee_; |
| 38 ExtensionDevToolsClientHost* client_host_; | 43 ExtensionDevToolsClientHost* client_host_; |
| 39 }; | 44 }; |
| 40 | 45 |
| 41 // Implements the debugger.attach() extension function. | 46 // Implements the debugger.attach() extension function. |
| 42 class DebuggerAttachFunction : public DebuggerFunction { | 47 class DebuggerAttachFunction : public DebuggerFunction { |
| 43 public: | 48 public: |
| 44 DECLARE_EXTENSION_FUNCTION("debugger.attach", DEBUGGER_ATTACH) | 49 DECLARE_EXTENSION_FUNCTION("debugger.attach", DEBUGGER_ATTACH) |
| 45 | 50 |
| 46 DebuggerAttachFunction(); | 51 DebuggerAttachFunction(); |
| 47 | 52 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 75 void SendResponseBody(base::DictionaryValue* result); | 80 void SendResponseBody(base::DictionaryValue* result); |
| 76 | 81 |
| 77 protected: | 82 protected: |
| 78 virtual ~DebuggerSendCommandFunction(); | 83 virtual ~DebuggerSendCommandFunction(); |
| 79 | 84 |
| 80 // ExtensionFunction: | 85 // ExtensionFunction: |
| 81 virtual bool RunImpl() OVERRIDE; | 86 virtual bool RunImpl() OVERRIDE; |
| 82 }; | 87 }; |
| 83 | 88 |
| 84 #endif // CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ | 89 #endif // CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ |
| OLD | NEW |