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

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

Issue 2777853005: Generalize the usage of referrer chain (Closed)
Patch Set: address lpz's comments 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_navigation_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9773f0646e4b97dbeca828f2d66f17d1fd02872b 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_->IdentifyReferrerChainByWebContents(
+ 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());
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_navigation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698