| 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/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/public/browser/devtools_http_handler.h" | 10 #include "content/public/browser/devtools_http_handler.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 DevToolsClientHost::SetupDevToolsFrontendClient( | 96 DevToolsClientHost::SetupDevToolsFrontendClient( |
| 97 web_contents()->GetRenderViewHost()); | 97 web_contents()->GetRenderViewHost()); |
| 98 DevToolsManager* manager = DevToolsManager::GetInstance(); | 98 DevToolsManager* manager = DevToolsManager::GetInstance(); |
| 99 manager->RegisterDevToolsClientHostFor(agent_host_.get(), | 99 manager->RegisterDevToolsClientHostFor(agent_host_.get(), |
| 100 frontend_host_.get()); | 100 frontend_host_.get()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame(int32 page_id) { | 103 void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame(int32 page_id) { |
| 104 web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame( | 104 web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame( |
| 105 base::string16(), | 105 base::string16(), |
| 106 ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); | 106 base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void ShellDevToolsFrontend::WebContentsDestroyed(WebContents* web_contents) { | 109 void ShellDevToolsFrontend::WebContentsDestroyed(WebContents* web_contents) { |
| 110 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); | 110 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); |
| 111 delete this; | 111 delete this; |
| 112 } | 112 } |
| 113 | 113 |
| 114 void ShellDevToolsFrontend::InspectedContentsClosing() { | 114 void ShellDevToolsFrontend::InspectedContentsClosing() { |
| 115 frontend_shell_->Close(); | 115 frontend_shell_->Close(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace content | 118 } // namespace content |
| OLD | NEW |