| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/shell_devtools_frontend.h" | 5 #include "content/shell/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 "content/public/browser/devtools_http_handler.h" | 9 #include "content/public/browser/devtools_http_handler.h" |
| 10 #include "content/public/browser/devtools_manager.h" | 10 #include "content/public/browser/devtools_manager.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/browser/web_contents_view.h" |
| 12 #include "content/public/common/content_client.h" | 13 #include "content/public/common/content_client.h" |
| 13 #include "content/shell/shell.h" | 14 #include "content/shell/shell.h" |
| 14 #include "content/shell/shell_browser_context.h" | 15 #include "content/shell/shell_browser_context.h" |
| 15 #include "content/shell/shell_browser_main_parts.h" | 16 #include "content/shell/shell_browser_main_parts.h" |
| 16 #include "content/shell/shell_content_browser_client.h" | 17 #include "content/shell/shell_content_browser_client.h" |
| 17 #include "content/shell/shell_devtools_delegate.h" | 18 #include "content/shell/shell_devtools_delegate.h" |
| 18 #include "content/shell/shell_switches.h" | 19 #include "content/shell/shell_switches.h" |
| 19 #include "net/base/net_util.h" | 20 #include "net/base/net_util.h" |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 browser_client->shell_browser_main_parts()->devtools_delegate(); | 59 browser_client->shell_browser_main_parts()->devtools_delegate(); |
| 59 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 60 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 60 shell->LoadURL(GetDevToolsPathAsURL()); | 61 shell->LoadURL(GetDevToolsPathAsURL()); |
| 61 else | 62 else |
| 62 shell->LoadURL(delegate->devtools_http_handler()->GetFrontendURL(NULL)); | 63 shell->LoadURL(delegate->devtools_http_handler()->GetFrontendURL(NULL)); |
| 63 | 64 |
| 64 return devtools_frontend; | 65 return devtools_frontend; |
| 65 } | 66 } |
| 66 | 67 |
| 67 void ShellDevToolsFrontend::Focus() { | 68 void ShellDevToolsFrontend::Focus() { |
| 68 web_contents()->Focus(); | 69 web_contents()->GetView()->Focus(); |
| 69 } | 70 } |
| 70 | 71 |
| 71 void ShellDevToolsFrontend::Close() { | 72 void ShellDevToolsFrontend::Close() { |
| 72 frontend_shell_->Close(); | 73 frontend_shell_->Close(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 ShellDevToolsFrontend::ShellDevToolsFrontend(Shell* frontend_shell, | 76 ShellDevToolsFrontend::ShellDevToolsFrontend(Shell* frontend_shell, |
| 76 DevToolsAgentHost* agent_host) | 77 DevToolsAgentHost* agent_host) |
| 77 : WebContentsObserver(frontend_shell->web_contents()), | 78 : WebContentsObserver(frontend_shell->web_contents()), |
| 78 frontend_shell_(frontend_shell), | 79 frontend_shell_(frontend_shell), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 96 void ShellDevToolsFrontend::WebContentsDestroyed(WebContents* web_contents) { | 97 void ShellDevToolsFrontend::WebContentsDestroyed(WebContents* web_contents) { |
| 97 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); | 98 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); |
| 98 delete this; | 99 delete this; |
| 99 } | 100 } |
| 100 | 101 |
| 101 void ShellDevToolsFrontend::InspectedContentsClosing() { | 102 void ShellDevToolsFrontend::InspectedContentsClosing() { |
| 102 frontend_shell_->Close(); | 103 frontend_shell_->Close(); |
| 103 } | 104 } |
| 104 | 105 |
| 105 } // namespace content | 106 } // namespace content |
| OLD | NEW |