Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7528)

Unified Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 2777853005: Generalize the usage of referrer chain (Closed)
Patch Set: nit Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/download_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 1a199a0345a395e9bef994dce1f36679f3110b9c..7f3370e8faf45795fd4dd721046cc7767f6252b6 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -1880,10 +1880,8 @@ std::unique_ptr<ReferrerChain> DownloadProtectionService::IdentifyReferrerChain(
download_tab_id == -1);
// We look for the referrer chain that leads to the download url first.
SafeBrowsingNavigationObserverManager::AttributionResult result =
- navigation_observer_manager_->IdentifyReferrerChainForDownload(
- download_url,
- download_tab_id,
- kDownloadAttributionUserGestureLimit,
+ navigation_observer_manager_->IdentifyReferrerChainByEventURL(
+ download_url, download_tab_id, kDownloadAttributionUserGestureLimit,
referrer_chain.get());
// If no navigation event is found, this download is not triggered by regular
@@ -1892,10 +1890,9 @@ std::unique_ptr<ReferrerChain> DownloadProtectionService::IdentifyReferrerChain(
if (result ==
SafeBrowsingNavigationObserverManager::NAVIGATION_EVENT_NOT_FOUND &&
web_contents && web_contents->GetLastCommittedURL().is_valid()) {
- result =
- navigation_observer_manager_->IdentifyReferrerChainByDownloadWebContent(
- web_contents, kDownloadAttributionUserGestureLimit,
- referrer_chain.get());
+ result = navigation_observer_manager_->IdentifyReferrerChainByWebContent(
+ web_contents, kDownloadAttributionUserGestureLimit,
+ referrer_chain.get());
}
UMA_HISTOGRAM_COUNTS_100(
@@ -1923,7 +1920,7 @@ void DownloadProtectionService::AddReferrerChainToPPAPIClientDownloadRequest(
"SafeBrowsing.ReferrerHasInvalidTabID.DownloadAttribution",
tab_id == -1);
SafeBrowsingNavigationObserverManager::AttributionResult result =
- navigation_observer_manager_->IdentifyReferrerChainForDownloadHostingPage(
+ navigation_observer_manager_->IdentifyReferrerChainByHostingPage(
initiating_frame_url, initiating_main_frame_url, tab_id,
has_user_gesture, kDownloadAttributionUserGestureLimit,
out_request->mutable_referrer_chain());

Powered by Google App Engine
This is Rietveld 408576698