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

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

Issue 2104423002: Stop using UMA preference to gate sending HitReport to SB backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 5 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
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui_manager.h" 5 #include "chrome/browser/safe_browsing/ui_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/debug/leak_tracker.h" 10 #include "base/debug/leak_tracker.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 SafeBrowsingBlockingPage::ShowBlockingPage(this, resource); 237 SafeBrowsingBlockingPage::ShowBlockingPage(this, resource);
238 } 238 }
239 239
240 // A safebrowsing hit is sent after a blocking page for malware/phishing 240 // A safebrowsing hit is sent after a blocking page for malware/phishing
241 // or after the warning dialog for download urls, only for 241 // or after the warning dialog for download urls, only for
242 // UMA || extended_reporting users. 242 // UMA || extended_reporting users.
243 void SafeBrowsingUIManager::MaybeReportSafeBrowsingHit( 243 void SafeBrowsingUIManager::MaybeReportSafeBrowsingHit(
244 const HitReport& hit_report) { 244 const HitReport& hit_report) {
245 DCHECK_CURRENTLY_ON(BrowserThread::UI); 245 DCHECK_CURRENTLY_ON(BrowserThread::UI);
246 246
247 // Decide if we should send this report. 247 // Send report if user opted-in extended reporting.
248 if (hit_report.is_metrics_reporting_active || 248 if (hit_report.is_extended_reporting) {
249 hit_report.is_extended_reporting) {
250 BrowserThread::PostTask( 249 BrowserThread::PostTask(
251 BrowserThread::IO, FROM_HERE, 250 BrowserThread::IO, FROM_HERE,
252 base::Bind(&SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread, 251 base::Bind(&SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread,
253 this, hit_report)); 252 this, hit_report));
254 } 253 }
255 } 254 }
256 255
257 void SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread( 256 void SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread(
258 const HitReport& hit_report) { 257 const HitReport& hit_report) {
259 DCHECK_CURRENTLY_ON(BrowserThread::IO); 258 DCHECK_CURRENTLY_ON(BrowserThread::IO);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 364 }
366 365
367 WhitelistUrlSet* site_list = 366 WhitelistUrlSet* site_list =
368 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey)); 367 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey));
369 if (!site_list) 368 if (!site_list)
370 return false; 369 return false;
371 return site_list->Contains(maybe_whitelisted_url); 370 return site_list->Contains(maybe_whitelisted_url);
372 } 371 }
373 372
374 } // namespace safe_browsing 373 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698