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

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

Issue 1409003002: [SafeBrowsing] Block dangerous unchecked downloads based on a Finch trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/unverified_download_policy.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/safe_browsing/unverified_download_policy.h"
6
7 #include "base/files/file_path.h"
8 #include "base/metrics/sparse_histogram.h"
9 #include "chrome/browser/safe_browsing/unverified_download_field_trial.h"
10 #include "chrome/common/safe_browsing/download_protection_util.h"
11
12 namespace safe_browsing {
13
14 bool IsUnverifiedDownloadAllowed(const base::FilePath& file) {
15 // Currently, the policy is determined entirely by a field trial.
16 bool is_allowed = IsUnverifiedDownloadAllowedByFieldTrial(file);
17 int uma_file_type =
18 download_protection_util::GetSBClientDownloadExtensionValueForUMA(file);
19 if (is_allowed) {
20 UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.UnverifiedDownloads.Allowed",
21 uma_file_type);
22 } else {
23 UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.UnverifiedDownloads.Blocked",
24 uma_file_type);
25 }
26 return is_allowed;
27 }
28
29 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/unverified_download_policy.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698