| 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 result = manager->delegate()->GetTargetTitle(current_->host()); | 897 result = manager->delegate()->GetTargetTitle(current_->host()); |
| 898 if (!result.empty()) | 898 if (!result.empty()) |
| 899 return result; | 899 return result; |
| 900 content::WebContents* web_contents = GetWebContents(); | 900 content::WebContents* web_contents = GetWebContents(); |
| 901 if (web_contents) | 901 if (web_contents) |
| 902 result = base::UTF16ToUTF8(web_contents->GetTitle()); | 902 result = base::UTF16ToUTF8(web_contents->GetTitle()); |
| 903 return GetURL().spec(); | 903 return GetURL().spec(); |
| 904 } | 904 } |
| 905 | 905 |
| 906 std::string RenderFrameDevToolsAgentHost::GetDescription() { | 906 std::string RenderFrameDevToolsAgentHost::GetDescription() { |
| 907 DevToolsManager* manager = DevToolsManager::GetInstance(); |
| 908 if (manager->delegate()) |
| 909 return manager->delegate()->GetTargetDescription(current_->host()); |
| 907 return ""; | 910 return ""; |
| 908 } | 911 } |
| 909 | 912 |
| 910 GURL RenderFrameDevToolsAgentHost::GetURL() { | 913 GURL RenderFrameDevToolsAgentHost::GetURL() { |
| 911 // Order is important here. | 914 // Order is important here. |
| 912 WebContents* web_contents = GetWebContents(); | 915 WebContents* web_contents = GetWebContents(); |
| 913 if (web_contents && !IsChildFrame()) | 916 if (web_contents && !IsChildFrame()) |
| 914 return web_contents->GetVisibleURL(); | 917 return web_contents->GetVisibleURL(); |
| 915 if (pending_) | 918 if (pending_) |
| 916 return pending_->host()->GetLastCommittedURL(); | 919 return pending_->host()->GetLastCommittedURL(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 RenderFrameHost* host) { | 1026 RenderFrameHost* host) { |
| 1024 return (current_ && current_->host() == host) || | 1027 return (current_ && current_->host() == host) || |
| 1025 (pending_ && pending_->host() == host); | 1028 (pending_ && pending_->host() == host); |
| 1026 } | 1029 } |
| 1027 | 1030 |
| 1028 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1031 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 1029 return current_ && current_->host()->GetParent(); | 1032 return current_ && current_->host()->GetParent(); |
| 1030 } | 1033 } |
| 1031 | 1034 |
| 1032 } // namespace content | 1035 } // namespace content |
| OLD | NEW |