| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() { | 85 void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() { |
| 86 web_contents()->GetMainFrame()->ExecuteJavaScript( | 86 web_contents()->GetMainFrame()->ExecuteJavaScript( |
| 87 base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); | 87 base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void ShellDevToolsFrontend::WebContentsDestroyed() { | 90 void ShellDevToolsFrontend::WebContentsDestroyed() { |
| 91 agent_host_->DetachClient(); | 91 agent_host_->DetachClient(); |
| 92 delete this; | 92 delete this; |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ShellDevToolsFrontend::RenderProcessGone(base::TerminationStatus status) { | |
| 96 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | |
| 97 WebKitTestController::Get()->DevToolsProcessCrashed(); | |
| 98 } | |
| 99 | |
| 100 void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend( | 95 void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend( |
| 101 const std::string& message) { | 96 const std::string& message) { |
| 102 std::string method; | 97 std::string method; |
| 103 std::string browser_message; | 98 std::string browser_message; |
| 104 int id = 0; | 99 int id = 0; |
| 105 | 100 |
| 106 base::ListValue* params = NULL; | 101 base::ListValue* params = NULL; |
| 107 base::DictionaryValue* dict = NULL; | 102 base::DictionaryValue* dict = NULL; |
| 108 scoped_ptr<base::Value> parsed_message(base::JSONReader::Read(message)); | 103 scoped_ptr<base::Value> parsed_message(base::JSONReader::Read(message)); |
| 109 if (!parsed_message || | 104 if (!parsed_message || |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 base::string16 javascript = base::UTF8ToUTF16(code); | 136 base::string16 javascript = base::UTF8ToUTF16(code); |
| 142 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); | 137 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); |
| 143 } | 138 } |
| 144 | 139 |
| 145 void ShellDevToolsFrontend::AgentHostClosed( | 140 void ShellDevToolsFrontend::AgentHostClosed( |
| 146 DevToolsAgentHost* agent_host, bool replaced) { | 141 DevToolsAgentHost* agent_host, bool replaced) { |
| 147 frontend_shell_->Close(); | 142 frontend_shell_->Close(); |
| 148 } | 143 } |
| 149 | 144 |
| 150 } // namespace content | 145 } // namespace content |
| OLD | NEW |