| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 GURL RenderFrameDevToolsAgentHost::GetURL() { | 450 GURL RenderFrameDevToolsAgentHost::GetURL() { |
| 451 WebContents* web_contents = GetWebContents(); | 451 WebContents* web_contents = GetWebContents(); |
| 452 if (web_contents && !IsChildFrame()) | 452 if (web_contents && !IsChildFrame()) |
| 453 return web_contents->GetVisibleURL(); | 453 return web_contents->GetVisibleURL(); |
| 454 return render_frame_host_ ? | 454 return render_frame_host_ ? |
| 455 render_frame_host_->GetLastCommittedURL() : GURL(); | 455 render_frame_host_->GetLastCommittedURL() : GURL(); |
| 456 } | 456 } |
| 457 | 457 |
| 458 bool RenderFrameDevToolsAgentHost::Activate() { | 458 bool RenderFrameDevToolsAgentHost::Activate() { |
| 459 if (render_frame_host_) { | 459 if (render_frame_host_) { |
| 460 render_frame_host_->GetRenderViewHost()->GetDelegate()->Activate(); | 460 render_frame_host_->GetRenderViewHost()->GetDelegate()->Activate( |
| 461 true /* user_gesture */); |
| 461 return true; | 462 return true; |
| 462 } | 463 } |
| 463 return false; | 464 return false; |
| 464 } | 465 } |
| 465 | 466 |
| 466 bool RenderFrameDevToolsAgentHost::Close() { | 467 bool RenderFrameDevToolsAgentHost::Close() { |
| 467 if (web_contents()) { | 468 if (web_contents()) { |
| 468 web_contents()->ClosePage(); | 469 web_contents()->ClosePage(); |
| 469 return true; | 470 return true; |
| 470 } | 471 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 if (!IsAttached() || !render_frame_host_) | 527 if (!IsAttached() || !render_frame_host_) |
| 527 return; | 528 return; |
| 528 ProcessChunkedMessageFromAgent(message); | 529 ProcessChunkedMessageFromAgent(message); |
| 529 } | 530 } |
| 530 | 531 |
| 531 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 532 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 532 return render_frame_host_ && render_frame_host_->GetParent(); | 533 return render_frame_host_ && render_frame_host_->GetParent(); |
| 533 } | 534 } |
| 534 | 535 |
| 535 } // namespace content | 536 } // namespace content |
| OLD | NEW |