| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/devtools/render_frame_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 std::string RenderFrameDevToolsAgentHost::UserAgentOverride( | 428 std::string RenderFrameDevToolsAgentHost::UserAgentOverride( |
| 429 FrameTreeNode* frame_tree_node) { | 429 FrameTreeNode* frame_tree_node) { |
| 430 RenderFrameDevToolsAgentHost* agent_host = GetAgentHostFor(frame_tree_node); | 430 RenderFrameDevToolsAgentHost* agent_host = GetAgentHostFor(frame_tree_node); |
| 431 if (!agent_host || !agent_host->session()) | 431 if (!agent_host || !agent_host->session()) |
| 432 return std::string(); | 432 return std::string(); |
| 433 return protocol::NetworkHandler::FromSession(agent_host->session()) | 433 return protocol::NetworkHandler::FromSession(agent_host->session()) |
| 434 ->UserAgentOverride(); | 434 ->UserAgentOverride(); |
| 435 } | 435 } |
| 436 | 436 |
| 437 // static | 437 // static |
| 438 std::string RenderFrameDevToolsAgentHost::GetAgentHostId( |
| 439 FrameTreeNode* frame_tree_node) { |
| 440 RenderFrameDevToolsAgentHost* agent_host = GetAgentHostFor(frame_tree_node); |
| 441 if (!agent_host) |
| 442 return std::string(); |
| 443 return agent_host->GetId(); |
| 444 } |
| 445 |
| 446 // static |
| 438 void RenderFrameDevToolsAgentHost::WebContentsCreated( | 447 void RenderFrameDevToolsAgentHost::WebContentsCreated( |
| 439 WebContents* web_contents) { | 448 WebContents* web_contents) { |
| 440 if (ShouldForceCreation()) { | 449 if (ShouldForceCreation()) { |
| 441 // Force agent host. | 450 // Force agent host. |
| 442 DevToolsAgentHost::GetOrCreateFor(web_contents); | 451 DevToolsAgentHost::GetOrCreateFor(web_contents); |
| 443 } | 452 } |
| 444 } | 453 } |
| 445 | 454 |
| 446 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( | 455 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( |
| 447 RenderFrameHostImpl* host) | 456 RenderFrameHostImpl* host) |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 RenderFrameHost* host) { | 1186 RenderFrameHost* host) { |
| 1178 return (current_ && current_->host() == host) || | 1187 return (current_ && current_->host() == host) || |
| 1179 (pending_ && pending_->host() == host); | 1188 (pending_ && pending_->host() == host); |
| 1180 } | 1189 } |
| 1181 | 1190 |
| 1182 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1191 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 1183 return current_ && current_->host()->GetParent(); | 1192 return current_ && current_->host()->GetParent(); |
| 1184 } | 1193 } |
| 1185 | 1194 |
| 1186 } // namespace content | 1195 } // namespace content |
| OLD | NEW |