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_delegate.h" | 5 #include "content/shell/browser/shell_devtools_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
23 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
24 #include "content/public/common/user_agent.h" | 24 #include "content/public/common/user_agent.h" |
25 #include "content/shell/browser/shell.h" | 25 #include "content/shell/browser/shell.h" |
26 #include "grit/shell_resources.h" | 26 #include "grit/shell_resources.h" |
27 #include "net/socket/tcp_listen_socket.h" | 27 #include "net/socket/tcp_listen_socket.h" |
28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
29 | 29 |
30 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
31 #include "content/public/browser/android/devtools_auth.h" | 31 #include "content/public/browser/android/devtools_auth.h" |
32 #include "net/socket/unix_domain_socket_posix.h" | 32 #include "net/socket/unix_domain_listen_socket_posix.h" |
33 #endif | 33 #endif |
34 | 34 |
35 using content::DevToolsAgentHost; | 35 using content::DevToolsAgentHost; |
36 using content::RenderViewHost; | 36 using content::RenderViewHost; |
37 using content::WebContents; | 37 using content::WebContents; |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
42 const char kFrontEndURL[] = | 42 const char kFrontEndURL[] = |
43 "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/devtools.html"; | 43 "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/devtools.html"; |
44 #endif | 44 #endif |
45 const char kTargetTypePage[] = "page"; | 45 const char kTargetTypePage[] = "page"; |
46 | 46 |
47 net::StreamListenSocketFactory* CreateSocketFactory() { | 47 net::StreamListenSocketFactory* CreateSocketFactory() { |
48 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 48 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
49 #if defined(OS_ANDROID) | 49 #if defined(OS_ANDROID) |
50 std::string socket_name = "content_shell_devtools_remote"; | 50 std::string socket_name = "content_shell_devtools_remote"; |
51 if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) { | 51 if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) { |
52 socket_name = command_line.GetSwitchValueASCII( | 52 socket_name = command_line.GetSwitchValueASCII( |
53 switches::kRemoteDebuggingSocketName); | 53 switches::kRemoteDebuggingSocketName); |
54 } | 54 } |
55 return new net::UnixDomainSocketWithAbstractNamespaceFactory( | 55 return new net::UnixDomainListenSocketWithAbstractNamespaceFactory( |
56 socket_name, "", base::Bind(&content::CanUserConnectToDevTools)); | 56 socket_name, "", base::Bind(&content::CanUserConnectToDevTools)); |
57 #else | 57 #else |
58 // See if the user specified a port on the command line (useful for | 58 // See if the user specified a port on the command line (useful for |
59 // automation). If not, use an ephemeral port by specifying 0. | 59 // automation). If not, use an ephemeral port by specifying 0. |
60 int port = 0; | 60 int port = 0; |
61 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { | 61 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { |
62 int temp_port; | 62 int temp_port; |
63 std::string port_str = | 63 std::string port_str = |
64 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); | 64 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
65 if (base::StringToInt(port_str, &temp_port) && | 65 if (base::StringToInt(port_str, &temp_port) && |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 | 210 |
211 scoped_ptr<net::StreamListenSocket> | 211 scoped_ptr<net::StreamListenSocket> |
212 ShellDevToolsDelegate::CreateSocketForTethering( | 212 ShellDevToolsDelegate::CreateSocketForTethering( |
213 net::StreamListenSocket::Delegate* delegate, | 213 net::StreamListenSocket::Delegate* delegate, |
214 std::string* name) { | 214 std::string* name) { |
215 return scoped_ptr<net::StreamListenSocket>(); | 215 return scoped_ptr<net::StreamListenSocket>(); |
216 } | 216 } |
217 | 217 |
218 } // namespace content | 218 } // namespace content |
OLD | NEW |