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

Side by Side Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 2886043002: Refrain from sending hit report when user is in incognito mode (Closed)
Patch Set: fixed comment typo Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/safe_browsing/download_protection_service.h" 5 #include "chrome/browser/safe_browsing/download_protection_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 hit_report.is_subresource = true; 282 hit_report.is_subresource = true;
283 hit_report.threat_type = threat_type; 283 hit_report.threat_type = threat_type;
284 // TODO(nparker) Replace this with database_manager_->GetThreatSource(); 284 // TODO(nparker) Replace this with database_manager_->GetThreatSource();
285 hit_report.threat_source = safe_browsing::ThreatSource::LOCAL_PVER3; 285 hit_report.threat_source = safe_browsing::ThreatSource::LOCAL_PVER3;
286 // TODO(nparker) Populate hit_report.population_id once Pver4 is used here. 286 // TODO(nparker) Populate hit_report.population_id once Pver4 is used here.
287 hit_report.post_data = post_data; 287 hit_report.post_data = post_data;
288 hit_report.extended_reporting_level = extended_reporting_level_; 288 hit_report.extended_reporting_level = extended_reporting_level_;
289 hit_report.is_metrics_reporting_active = 289 hit_report.is_metrics_reporting_active =
290 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(); 290 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled();
291 291
292 ui_manager_->MaybeReportSafeBrowsingHit(hit_report); 292 ui_manager_->MaybeReportSafeBrowsingHit(hit_report,
293 item_->GetWebContents());
293 } 294 }
294 295
295 void IdentifyReferrerChain() { 296 void IdentifyReferrerChain() {
296 DCHECK_CURRENTLY_ON(BrowserThread::UI); 297 DCHECK_CURRENTLY_ON(BrowserThread::UI);
297 if (!item_) 298 if (!item_)
298 return; 299 return;
299 300
300 item_->SetUserData( 301 item_->SetUserData(
301 kDownloadReferrerChainDataKey, 302 kDownloadReferrerChainDataKey,
302 base::MakeUnique<ReferrerChainData>(service_->IdentifyReferrerChain( 303 base::MakeUnique<ReferrerChainData>(service_->IdentifyReferrerChain(
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 out_request->mutable_referrer_chain()); 1991 out_request->mutable_referrer_chain());
1991 UMA_HISTOGRAM_COUNTS_100( 1992 UMA_HISTOGRAM_COUNTS_100(
1992 "SafeBrowsing.ReferrerURLChainSize.PPAPIDownloadAttribution", 1993 "SafeBrowsing.ReferrerURLChainSize.PPAPIDownloadAttribution",
1993 out_request->referrer_chain_size()); 1994 out_request->referrer_chain_size());
1994 UMA_HISTOGRAM_ENUMERATION( 1995 UMA_HISTOGRAM_ENUMERATION(
1995 "SafeBrowsing.ReferrerAttributionResult.PPAPIDownloadAttribution", result, 1996 "SafeBrowsing.ReferrerAttributionResult.PPAPIDownloadAttribution", result,
1996 SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX); 1997 SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX);
1997 } 1998 }
1998 1999
1999 } // namespace safe_browsing 2000 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698