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_frontend.h" | 5 #include "content/shell/browser/shell_devtools_frontend.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace content { | 27 namespace content { |
28 | 28 |
29 // static | 29 // static |
30 ShellDevToolsFrontend* ShellDevToolsFrontend::Show( | 30 ShellDevToolsFrontend* ShellDevToolsFrontend::Show( |
31 WebContents* inspected_contents) { | 31 WebContents* inspected_contents) { |
32 scoped_refptr<DevToolsAgentHost> agent( | 32 scoped_refptr<DevToolsAgentHost> agent( |
33 DevToolsAgentHost::GetOrCreateFor(inspected_contents)); | 33 DevToolsAgentHost::GetOrCreateFor(inspected_contents)); |
34 Shell* shell = Shell::CreateNewWindow(inspected_contents->GetBrowserContext(), | 34 Shell* shell = Shell::CreateNewWindow(inspected_contents->GetBrowserContext(), |
35 GURL(), | 35 GURL(), |
36 NULL, | 36 NULL, |
37 MSG_ROUTING_NONE, | |
38 gfx::Size()); | 37 gfx::Size()); |
39 ShellDevToolsFrontend* devtools_frontend = new ShellDevToolsFrontend( | 38 ShellDevToolsFrontend* devtools_frontend = new ShellDevToolsFrontend( |
40 shell, | 39 shell, |
41 agent.get()); | 40 agent.get()); |
42 | 41 |
43 DevToolsHttpHandler* http_handler = ShellContentBrowserClient::Get() | 42 DevToolsHttpHandler* http_handler = ShellContentBrowserClient::Get() |
44 ->shell_browser_main_parts() | 43 ->shell_browser_main_parts() |
45 ->devtools_http_handler(); | 44 ->devtools_http_handler(); |
46 shell->LoadURL(http_handler->GetFrontendURL("/devtools/devtools.html")); | 45 shell->LoadURL(http_handler->GetFrontendURL("/devtools/devtools.html")); |
47 | 46 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 base::string16 javascript = base::UTF8ToUTF16(code); | 135 base::string16 javascript = base::UTF8ToUTF16(code); |
137 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); | 136 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); |
138 } | 137 } |
139 | 138 |
140 void ShellDevToolsFrontend::AgentHostClosed( | 139 void ShellDevToolsFrontend::AgentHostClosed( |
141 DevToolsAgentHost* agent_host, bool replaced) { | 140 DevToolsAgentHost* agent_host, bool replaced) { |
142 frontend_shell_->Close(); | 141 frontend_shell_->Close(); |
143 } | 142 } |
144 | 143 |
145 } // namespace content | 144 } // namespace content |
OLD | NEW |