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 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 5 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "content/public/browser/browser_context.h" | 21 #include "content/public/browser/browser_context.h" |
22 #include "content/public/browser/devtools_agent_host.h" | 22 #include "content/public/browser/devtools_agent_host.h" |
23 #include "content/public/browser/devtools_socket_factory.h" | 23 #include "content/public/browser/devtools_socket_factory.h" |
24 #include "content/public/browser/favicon_status.h" | 24 #include "content/public/browser/favicon_status.h" |
25 #include "content/public/browser/navigation_entry.h" | 25 #include "content/public/browser/navigation_entry.h" |
26 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
28 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
29 #include "content/public/common/url_constants.h" | 29 #include "content/public/common/url_constants.h" |
30 #include "content/public/common/user_agent.h" | 30 #include "content/public/common/user_agent.h" |
| 31 #include "content/shell/browser/layout_test/secondary_test_window_observer.h" |
31 #include "content/shell/browser/shell.h" | 32 #include "content/shell/browser/shell.h" |
32 #include "content/shell/common/shell_content_client.h" | 33 #include "content/shell/common/shell_content_client.h" |
| 34 #include "content/shell/common/shell_switches.h" |
33 #include "content/shell/grit/shell_resources.h" | 35 #include "content/shell/grit/shell_resources.h" |
34 #include "net/base/net_errors.h" | 36 #include "net/base/net_errors.h" |
35 #include "net/log/net_log_source.h" | 37 #include "net/log/net_log_source.h" |
36 #include "net/socket/tcp_server_socket.h" | 38 #include "net/socket/tcp_server_socket.h" |
37 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
38 | 40 |
39 #if !defined(OS_ANDROID) | 41 #if !defined(OS_ANDROID) |
40 #include "content/public/browser/devtools_frontend_host.h" | 42 #include "content/public/browser/devtools_frontend_host.h" |
41 #endif | 43 #endif |
42 | 44 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 188 |
187 ShellDevToolsManagerDelegate::~ShellDevToolsManagerDelegate() { | 189 ShellDevToolsManagerDelegate::~ShellDevToolsManagerDelegate() { |
188 } | 190 } |
189 | 191 |
190 scoped_refptr<DevToolsAgentHost> | 192 scoped_refptr<DevToolsAgentHost> |
191 ShellDevToolsManagerDelegate::CreateNewTarget(const GURL& url) { | 193 ShellDevToolsManagerDelegate::CreateNewTarget(const GURL& url) { |
192 Shell* shell = Shell::CreateNewWindow(browser_context_, | 194 Shell* shell = Shell::CreateNewWindow(browser_context_, |
193 url, | 195 url, |
194 nullptr, | 196 nullptr, |
195 gfx::Size()); | 197 gfx::Size()); |
| 198 if (switches::IsRunLayoutTestSwitchPresent()) |
| 199 SecondaryTestWindowObserver::CreateForWebContents(shell->web_contents()); |
196 return DevToolsAgentHost::GetOrCreateFor(shell->web_contents()); | 200 return DevToolsAgentHost::GetOrCreateFor(shell->web_contents()); |
197 } | 201 } |
198 | 202 |
199 std::string ShellDevToolsManagerDelegate::GetDiscoveryPageHTML() { | 203 std::string ShellDevToolsManagerDelegate::GetDiscoveryPageHTML() { |
200 #if defined(OS_ANDROID) | 204 #if defined(OS_ANDROID) |
201 return std::string(); | 205 return std::string(); |
202 #else | 206 #else |
203 return ResourceBundle::GetSharedInstance().GetRawDataResource( | 207 return ResourceBundle::GetSharedInstance().GetRawDataResource( |
204 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string(); | 208 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string(); |
205 #endif | 209 #endif |
206 } | 210 } |
207 | 211 |
208 std::string ShellDevToolsManagerDelegate::GetFrontendResource( | 212 std::string ShellDevToolsManagerDelegate::GetFrontendResource( |
209 const std::string& path) { | 213 const std::string& path) { |
210 #if defined(OS_ANDROID) | 214 #if defined(OS_ANDROID) |
211 return std::string(); | 215 return std::string(); |
212 #else | 216 #else |
213 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string(); | 217 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string(); |
214 #endif | 218 #endif |
215 } | 219 } |
216 | 220 |
217 } // namespace content | 221 } // namespace content |
OLD | NEW |