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/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 WebContents* inspected_contents) { | 59 WebContents* inspected_contents) { |
60 return ShellDevToolsFrontend::Show(inspected_contents, "", ""); | 60 return ShellDevToolsFrontend::Show(inspected_contents, "", ""); |
61 } | 61 } |
62 | 62 |
63 // static | 63 // static |
64 ShellDevToolsFrontend* ShellDevToolsFrontend::Show( | 64 ShellDevToolsFrontend* ShellDevToolsFrontend::Show( |
65 WebContents* inspected_contents, | 65 WebContents* inspected_contents, |
66 const std::string& settings, | 66 const std::string& settings, |
67 const std::string& frontend_url) { | 67 const std::string& frontend_url) { |
68 scoped_refptr<DevToolsAgentHost> agent( | 68 scoped_refptr<DevToolsAgentHost> agent( |
69 DevToolsAgentHost::GetOrCreateFor( | 69 DevToolsAgentHost::GetOrCreateFor(inspected_contents)); |
70 inspected_contents->GetRenderViewHost())); | |
71 Shell* shell = Shell::CreateNewWindow(inspected_contents->GetBrowserContext(), | 70 Shell* shell = Shell::CreateNewWindow(inspected_contents->GetBrowserContext(), |
72 GURL(), | 71 GURL(), |
73 NULL, | 72 NULL, |
74 MSG_ROUTING_NONE, | 73 MSG_ROUTING_NONE, |
75 gfx::Size()); | 74 gfx::Size()); |
76 ShellDevToolsFrontend* devtools_frontend = new ShellDevToolsFrontend( | 75 ShellDevToolsFrontend* devtools_frontend = new ShellDevToolsFrontend( |
77 shell, | 76 shell, |
78 agent.get()); | 77 agent.get()); |
79 | 78 |
80 ShellDevToolsDelegate* delegate = ShellContentBrowserClient::Get()-> | 79 ShellDevToolsDelegate* delegate = ShellContentBrowserClient::Get()-> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 std::string code = "InspectorFrontendAPI.dispatchMessage(" + message + ");"; | 181 std::string code = "InspectorFrontendAPI.dispatchMessage(" + message + ");"; |
183 base::string16 javascript = base::UTF8ToUTF16(code); | 182 base::string16 javascript = base::UTF8ToUTF16(code); |
184 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); | 183 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); |
185 } | 184 } |
186 | 185 |
187 void ShellDevToolsFrontend::InspectedContentsClosing() { | 186 void ShellDevToolsFrontend::InspectedContentsClosing() { |
188 frontend_shell_->Close(); | 187 frontend_shell_->Close(); |
189 } | 188 } |
190 | 189 |
191 } // namespace content | 190 } // namespace content |
OLD | NEW |