Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: chrome/browser/extensions/api/debugger/debugger_api.h

Issue 12304021: Allow chrome.debugger API to attach to extension background pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More descriptive flag name. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/extensions/api/debugger/debugger_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/extensions/api/debugger/debugger_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698