OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/devtools/chrome_devtools_manager_delegate.h" | 5 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/devtools/devtools_network_protocol_handler.h" | 9 #include "chrome/browser/devtools/devtools_network_protocol_handler.h" |
10 #include "chrome/browser/devtools/devtools_window.h" | 10 #include "chrome/browser/devtools/devtools_window.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 Profile* profile = | 42 Profile* profile = |
43 Profile::FromBrowserContext(agent_host->GetBrowserContext()); | 43 Profile::FromBrowserContext(agent_host->GetBrowserContext()); |
44 if (!profile) | 44 if (!profile) |
45 return; | 45 return; |
46 std::string type = agent_host->GetType(); | 46 std::string type = agent_host->GetType(); |
47 if (type == content::DevToolsAgentHost::kTypeSharedWorker || | 47 if (type == content::DevToolsAgentHost::kTypeSharedWorker || |
48 type == content::DevToolsAgentHost::kTypeServiceWorker) { | 48 type == content::DevToolsAgentHost::kTypeServiceWorker) { |
49 DevToolsWindow::OpenDevToolsWindowForWorker(profile, agent_host); | 49 DevToolsWindow::OpenDevToolsWindowForWorker(profile, agent_host); |
50 return; | 50 return; |
51 } | 51 } |
| 52 if (type == content::DevToolsAgentHost::kTypeFrame) { |
| 53 DevToolsWindow::OpenDevToolsWindow(profile, agent_host); |
| 54 return; |
| 55 } |
52 content::WebContents* web_contents = agent_host->GetWebContents(); | 56 content::WebContents* web_contents = agent_host->GetWebContents(); |
53 if (web_contents) | 57 if (web_contents) |
54 DevToolsWindow::OpenDevToolsWindow(web_contents); | 58 DevToolsWindow::OpenDevToolsWindow(web_contents); |
55 } | 59 } |
56 | 60 |
57 base::DictionaryValue* ChromeDevToolsManagerDelegate::HandleCommand( | 61 base::DictionaryValue* ChromeDevToolsManagerDelegate::HandleCommand( |
58 content::DevToolsAgentHost* agent_host, | 62 content::DevToolsAgentHost* agent_host, |
59 base::DictionaryValue* command_dict) { | 63 base::DictionaryValue* command_dict) { |
60 return network_protocol_handler_->HandleCommand(agent_host, command_dict); | 64 return network_protocol_handler_->HandleCommand(agent_host, command_dict); |
61 } | 65 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 std::string ChromeDevToolsManagerDelegate::GetFrontendResource( | 146 std::string ChromeDevToolsManagerDelegate::GetFrontendResource( |
143 const std::string& path) { | 147 const std::string& path) { |
144 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string(); | 148 return content::DevToolsFrontendHost::GetFrontendResource(path).as_string(); |
145 } | 149 } |
146 | 150 |
147 void ChromeDevToolsManagerDelegate::DevToolsAgentStateChanged( | 151 void ChromeDevToolsManagerDelegate::DevToolsAgentStateChanged( |
148 content::DevToolsAgentHost* agent_host, | 152 content::DevToolsAgentHost* agent_host, |
149 bool attached) { | 153 bool attached) { |
150 network_protocol_handler_->DevToolsAgentStateChanged(agent_host, attached); | 154 network_protocol_handler_->DevToolsAgentStateChanged(agent_host, attached); |
151 } | 155 } |
OLD | NEW |