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/devtools_http_handler_impl.h" | 5 #include "content/browser/devtools/devtools_http_handler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 | 809 |
810 WebContents* web_contents = rvh->GetDelegate()->GetAsWebContents(); | 810 WebContents* web_contents = rvh->GetDelegate()->GetAsWebContents(); |
811 if (web_contents) { | 811 if (web_contents) { |
812 dictionary->SetString(kTargetTitleField, UTF16ToUTF8( | 812 dictionary->SetString(kTargetTitleField, UTF16ToUTF8( |
813 net::EscapeForHTML(web_contents->GetTitle()))); | 813 net::EscapeForHTML(web_contents->GetTitle()))); |
814 dictionary->SetString(kTargetUrlField, web_contents->GetURL().spec()); | 814 dictionary->SetString(kTargetUrlField, web_contents->GetURL().spec()); |
815 dictionary->SetString(kTargetThumbnailUrlField, | 815 dictionary->SetString(kTargetThumbnailUrlField, |
816 std::string(kThumbUrlPrefix) + id); | 816 std::string(kThumbUrlPrefix) + id); |
817 | 817 |
818 NavigationController& controller = web_contents->GetController(); | 818 NavigationController& controller = web_contents->GetController(); |
819 NavigationEntry* entry = controller.GetActiveEntry(); | 819 NavigationEntry* entry = controller.GetVisibleEntry(); |
820 if (entry != NULL && entry->GetURL().is_valid()) { | 820 if (entry != NULL && entry->GetURL().is_valid()) { |
821 dictionary->SetString(kTargetFaviconUrlField, | 821 dictionary->SetString(kTargetFaviconUrlField, |
822 entry->GetFavicon().url.spec()); | 822 entry->GetFavicon().url.spec()); |
823 } | 823 } |
824 } | 824 } |
825 dictionary->SetString(kTargetDescriptionField, | 825 dictionary->SetString(kTargetDescriptionField, |
826 delegate_->GetViewDescription(rvh)); | 826 delegate_->GetViewDescription(rvh)); |
827 | 827 |
828 if (!agent->IsAttached()) | 828 if (!agent->IsAttached()) |
829 SerializeDebuggerURLs(dictionary, id, host); | 829 SerializeDebuggerURLs(dictionary, id, host); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 host.c_str(), | 862 host.c_str(), |
863 kPageUrlPrefix, | 863 kPageUrlPrefix, |
864 id.c_str())); | 864 id.c_str())); |
865 std::string devtools_frontend_url = GetFrontendURLInternal( | 865 std::string devtools_frontend_url = GetFrontendURLInternal( |
866 id.c_str(), | 866 id.c_str(), |
867 host); | 867 host); |
868 dictionary->SetString(kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 868 dictionary->SetString(kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
869 } | 869 } |
870 | 870 |
871 } // namespace content | 871 } // namespace content |
OLD | NEW |