| Index: chrome/browser/safe_browsing/threat_details.cc
|
| diff --git a/chrome/browser/safe_browsing/threat_details.cc b/chrome/browser/safe_browsing/threat_details.cc
|
| index af89c5ccf0a2a0cd045e05e81f0f14dfbaa377fe..433ccb20238f453ac396b5f6ce20dd85c7db855c 100644
|
| --- a/chrome/browser/safe_browsing/threat_details.cc
|
| +++ b/chrome/browser/safe_browsing/threat_details.cc
|
| @@ -182,21 +182,20 @@ void ThreatDetails::StartCollection() {
|
| report_->set_type(GetReportTypeFromSBThreatType(resource_.threat_type));
|
| }
|
|
|
| - GURL page_url = web_contents()->GetURL();
|
| - if (IsReportableUrl(page_url))
|
| - report_->set_page_url(page_url.spec());
|
| -
|
| GURL referrer_url;
|
| - NavigationEntry* nav_entry = web_contents()->GetController().GetActiveEntry();
|
| + NavigationEntry* nav_entry = resource_.GetNavigationEntryForResource();
|
| if (nav_entry) {
|
| + GURL page_url = nav_entry->GetURL();
|
| + if (IsReportableUrl(page_url))
|
| + report_->set_page_url(page_url.spec());
|
| +
|
| referrer_url = nav_entry->GetReferrer().url;
|
| - if (IsReportableUrl(referrer_url)) {
|
| + if (IsReportableUrl(referrer_url))
|
| report_->set_referrer_url(referrer_url.spec());
|
| - }
|
| - }
|
|
|
| - // Add the nodes, starting from the page url.
|
| - AddUrl(page_url, GURL(), std::string(), NULL);
|
| + // Add the nodes, starting from the page url.
|
| + AddUrl(page_url, GURL(), std::string(), NULL);
|
| + }
|
|
|
| // Add the resource_url and its original url, if non-empty and different.
|
| if (!resource_.original_url.is_empty() &&
|
| @@ -224,7 +223,7 @@ void ThreatDetails::StartCollection() {
|
| }
|
|
|
| // Add the referrer url.
|
| - if (nav_entry && !referrer_url.is_empty())
|
| + if (!referrer_url.is_empty())
|
| AddUrl(referrer_url, GURL(), std::string(), NULL);
|
|
|
| if (!resource_.IsMainPageLoadBlocked()) {
|
|
|