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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 if (web_contents && !IsChildFrame()) | 913 if (web_contents && !IsChildFrame()) |
914 return web_contents->GetVisibleURL(); | 914 return web_contents->GetVisibleURL(); |
915 if (pending_) | 915 if (pending_) |
916 return pending_->host()->GetLastCommittedURL(); | 916 return pending_->host()->GetLastCommittedURL(); |
917 if (current_) | 917 if (current_) |
918 return current_->host()->GetLastCommittedURL(); | 918 return current_->host()->GetLastCommittedURL(); |
919 return GURL(); | 919 return GURL(); |
920 } | 920 } |
921 | 921 |
922 GURL RenderFrameDevToolsAgentHost::GetFaviconURL() { | 922 GURL RenderFrameDevToolsAgentHost::GetFaviconURL() { |
| 923 WebContents* wc = web_contents(); |
| 924 if (!wc) |
| 925 return GURL(); |
| 926 NavigationEntry* entry = wc->GetController().GetLastCommittedEntry(); |
| 927 if (entry) |
| 928 return entry->GetFavicon().url; |
923 return GURL(); | 929 return GURL(); |
924 } | 930 } |
925 | 931 |
926 bool RenderFrameDevToolsAgentHost::Activate() { | 932 bool RenderFrameDevToolsAgentHost::Activate() { |
927 WebContentsImpl* wc = static_cast<WebContentsImpl*>(web_contents()); | 933 WebContentsImpl* wc = static_cast<WebContentsImpl*>(web_contents()); |
928 if (wc) { | 934 if (wc) { |
929 wc->Activate(); | 935 wc->Activate(); |
930 return true; | 936 return true; |
931 } | 937 } |
932 return false; | 938 return false; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 RenderFrameHost* host) { | 1023 RenderFrameHost* host) { |
1018 return (current_ && current_->host() == host) || | 1024 return (current_ && current_->host() == host) || |
1019 (pending_ && pending_->host() == host); | 1025 (pending_ && pending_->host() == host); |
1020 } | 1026 } |
1021 | 1027 |
1022 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1028 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
1023 return current_ && current_->host()->GetParent(); | 1029 return current_ && current_->host()->GetParent(); |
1024 } | 1030 } |
1025 | 1031 |
1026 } // namespace content | 1032 } // namespace content |
OLD | NEW |