OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/public/browser/devtools_http_handler_delegate.h" | 10 #include "content/public/browser/devtools_http_handler_delegate.h" |
| 11 #include "content/public/browser/devtools_manager_delegate.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 class BrowserContext; | 15 class BrowserContext; |
15 class DevToolsHttpHandler; | 16 class DevToolsHttpHandler; |
16 | 17 |
17 class ShellDevToolsDelegate : public DevToolsHttpHandlerDelegate { | 18 class ShellDevToolsDelegate : public DevToolsHttpHandlerDelegate { |
18 public: | 19 public: |
19 explicit ShellDevToolsDelegate(BrowserContext* browser_context); | 20 explicit ShellDevToolsDelegate(BrowserContext* browser_context); |
20 virtual ~ShellDevToolsDelegate(); | 21 virtual ~ShellDevToolsDelegate(); |
21 | 22 |
22 // Stops http server. | 23 // Stops http server. |
23 void Stop(); | 24 void Stop(); |
24 | 25 |
25 // DevToolsHttpProtocolHandler::Delegate overrides. | 26 // DevToolsHttpHandlerDelegate implementation. |
26 virtual std::string GetDiscoveryPageHTML() OVERRIDE; | 27 virtual std::string GetDiscoveryPageHTML() OVERRIDE; |
27 virtual bool BundlesFrontendResources() OVERRIDE; | 28 virtual bool BundlesFrontendResources() OVERRIDE; |
28 virtual base::FilePath GetDebugFrontendDir() OVERRIDE; | 29 virtual base::FilePath GetDebugFrontendDir() OVERRIDE; |
29 virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE; | |
30 virtual scoped_ptr<DevToolsTarget> CreateNewTarget(const GURL& url) OVERRIDE; | |
31 virtual void EnumerateTargets(TargetCallback callback) OVERRIDE; | |
32 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( | 30 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( |
33 net::StreamListenSocket::Delegate* delegate, | 31 net::StreamListenSocket::Delegate* delegate, |
34 std::string* name) OVERRIDE; | 32 std::string* name) OVERRIDE; |
35 | 33 |
36 DevToolsHttpHandler* devtools_http_handler() { | 34 DevToolsHttpHandler* devtools_http_handler() { |
37 return devtools_http_handler_; | 35 return devtools_http_handler_; |
38 } | 36 } |
39 | 37 |
40 private: | 38 private: |
41 BrowserContext* browser_context_; | 39 BrowserContext* browser_context_; |
42 DevToolsHttpHandler* devtools_http_handler_; | 40 DevToolsHttpHandler* devtools_http_handler_; |
43 | 41 |
44 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsDelegate); | 42 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsDelegate); |
45 }; | 43 }; |
46 | 44 |
| 45 class ShellDevToolsManagerDelegate : public DevToolsManagerDelegate { |
| 46 public: |
| 47 explicit ShellDevToolsManagerDelegate(BrowserContext* browser_context); |
| 48 virtual ~ShellDevToolsManagerDelegate(); |
| 49 |
| 50 // DevToolsManagerDelegate implementation. |
| 51 virtual void Inspect(BrowserContext* browser_context, |
| 52 DevToolsAgentHost* agent_host) OVERRIDE {} |
| 53 virtual void DevToolsAgentStateChanged(DevToolsAgentHost* agent_host, |
| 54 bool attached) OVERRIDE {} |
| 55 virtual base::DictionaryValue* HandleCommand( |
| 56 DevToolsAgentHost* agent_host, |
| 57 base::DictionaryValue* command) OVERRIDE; |
| 58 virtual scoped_ptr<DevToolsTarget> CreateNewTarget(const GURL& url) OVERRIDE; |
| 59 virtual void EnumerateTargets(TargetCallback callback) OVERRIDE; |
| 60 virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE; |
| 61 |
| 62 private: |
| 63 BrowserContext* browser_context_; |
| 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsManagerDelegate); |
| 66 }; |
| 67 |
47 } // namespace content | 68 } // namespace content |
48 | 69 |
49 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_ | 70 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_ |
OLD | NEW |