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 #include "content/shell/shell_devtools_delegate.h" | 5 #include "content/shell/shell_devtools_delegate.h" |
6 | 6 |
7 #include "content/public/browser/devtools_http_handler.h" | 7 #include "content/public/browser/devtools_http_handler.h" |
| 8 #include "content/public/browser/web_contents.h" |
| 9 #include "content/shell/shell.h" |
8 #include "grit/shell_resources.h" | 10 #include "grit/shell_resources.h" |
9 #include "net/base/tcp_listen_socket.h" | 11 #include "net/base/tcp_listen_socket.h" |
10 #include "net/url_request/url_request_context_getter.h" | 12 #include "net/url_request/url_request_context_getter.h" |
11 #include "ui/base/layout.h" | 13 #include "ui/base/layout.h" |
12 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
13 | 15 |
14 namespace content { | 16 namespace content { |
15 | 17 |
16 ShellDevToolsDelegate::ShellDevToolsDelegate(int port) { | 18 ShellDevToolsDelegate::ShellDevToolsDelegate(BrowserContext* browser_context, |
| 19 int port) |
| 20 : browser_context_(browser_context) { |
17 devtools_http_handler_ = DevToolsHttpHandler::Start( | 21 devtools_http_handler_ = DevToolsHttpHandler::Start( |
18 new net::TCPListenSocketFactory("127.0.0.1", port), | 22 new net::TCPListenSocketFactory("127.0.0.1", port), |
19 "", | 23 "", |
20 this); | 24 this); |
21 } | 25 } |
22 | 26 |
23 ShellDevToolsDelegate::~ShellDevToolsDelegate() { | 27 ShellDevToolsDelegate::~ShellDevToolsDelegate() { |
24 } | 28 } |
25 | 29 |
26 void ShellDevToolsDelegate::Stop() { | 30 void ShellDevToolsDelegate::Stop() { |
(...skipping 12 matching lines...) Expand all Loading... |
39 } | 43 } |
40 | 44 |
41 FilePath ShellDevToolsDelegate::GetDebugFrontendDir() { | 45 FilePath ShellDevToolsDelegate::GetDebugFrontendDir() { |
42 return FilePath(); | 46 return FilePath(); |
43 } | 47 } |
44 | 48 |
45 std::string ShellDevToolsDelegate::GetPageThumbnailData(const GURL& url) { | 49 std::string ShellDevToolsDelegate::GetPageThumbnailData(const GURL& url) { |
46 return ""; | 50 return ""; |
47 } | 51 } |
48 | 52 |
| 53 RenderViewHost* ShellDevToolsDelegate::CreateNewTarget() { |
| 54 Shell* shell = Shell::CreateNewWindow(browser_context_, |
| 55 GURL("about:blank"), |
| 56 NULL, |
| 57 MSG_ROUTING_NONE, |
| 58 NULL); |
| 59 return shell->web_contents()->GetRenderViewHost(); |
| 60 } |
| 61 |
49 } // namespace content | 62 } // namespace content |
OLD | NEW |