| 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/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "content/public/browser/devtools_http_handler.h" | 11 #include "content/public/browser/devtools_http_handler.h" |
| 12 #include "content/public/browser/devtools_manager.h" | 12 #include "content/public/browser/devtools_manager.h" |
| 13 #include "content/public/browser/render_frame_host.h" | 13 #include "content/public/browser/render_frame_host.h" |
| 14 #include "content/public/browser/render_view_host.h" | 14 #include "content/public/browser/render_view_host.h" |
| 15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 16 #include "content/public/common/content_client.h" | 16 #include "content/public/common/content_client.h" |
| 17 #include "content/shell/browser/shell.h" | 17 #include "content/shell/browser/shell.h" |
| 18 #include "content/shell/browser/shell_browser_context.h" | 18 #include "content/shell/browser/shell_browser_context.h" |
| 19 #include "content/shell/browser/shell_browser_main_parts.h" | 19 #include "content/shell/browser/shell_browser_main_parts.h" |
| 20 #include "content/shell/browser/shell_content_browser_client.h" | 20 #include "content/shell/browser/shell_content_browser_client.h" |
| 21 #include "content/shell/browser/shell_devtools_delegate.h" | 21 #include "content/shell/browser/shell_devtools_delegate.h" |
| 22 #include "content/shell/browser/webkit_test_controller.h" |
| 22 #include "content/shell/common/shell_switches.h" | 23 #include "content/shell/common/shell_switches.h" |
| 23 #include "net/base/filename_util.h" | 24 #include "net/base/filename_util.h" |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| 26 | 27 |
| 27 // DevTools frontend path for inspector LayoutTests. | 28 // DevTools frontend path for inspector LayoutTests. |
| 28 GURL GetDevToolsPathAsURL(const std::string& settings, | 29 GURL GetDevToolsPathAsURL(const std::string& settings, |
| 29 const std::string& frontend_url) { | 30 const std::string& frontend_url) { |
| 30 if (!frontend_url.empty()) | 31 if (!frontend_url.empty()) |
| 31 return GURL(frontend_url); | 32 return GURL(frontend_url); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() { | 125 void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() { |
| 125 web_contents()->GetMainFrame()->ExecuteJavaScript( | 126 web_contents()->GetMainFrame()->ExecuteJavaScript( |
| 126 base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); | 127 base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); |
| 127 } | 128 } |
| 128 | 129 |
| 129 void ShellDevToolsFrontend::WebContentsDestroyed() { | 130 void ShellDevToolsFrontend::WebContentsDestroyed() { |
| 130 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); | 131 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); |
| 131 delete this; | 132 delete this; |
| 132 } | 133 } |
| 133 | 134 |
| 135 void ShellDevToolsFrontend::RenderProcessGone(base::TerminationStatus status) { |
| 136 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 137 WebKitTestController::Get()->DevToolsProcessCrashed(); |
| 138 } |
| 139 |
| 134 void ShellDevToolsFrontend::InspectedContentsClosing() { | 140 void ShellDevToolsFrontend::InspectedContentsClosing() { |
| 135 frontend_shell_->Close(); | 141 frontend_shell_->Close(); |
| 136 } | 142 } |
| 137 | 143 |
| 138 } // namespace content | 144 } // namespace content |
| OLD | NEW |