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

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, 2 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/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. Use of this source
2 // code is governed by a BSD-style license that can be found in the LICENSE
3 // file.
4
5 #include "chrome/browser/safe_browsing/unverified_download_policy.h"
6
7 #include "base/files/file_path.h"
8 #include "base/metrics/histogram_macros.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_ENUMERATION(
21 "SafeBrowsing.UnverifiedDownloads.Allowed", uma_file_type,
22 download_protection_util::kSBClientDownloadExtensionsMax);
23 } else {
24 UMA_HISTOGRAM_ENUMERATION(
25 "SafeBrowsing.UnverifiedDownloads.Blocked", uma_file_type,
26 download_protection_util::kSBClientDownloadExtensionsMax);
Ilya Sherman 2015/10/23 20:04:42 Could you use UMA_HISTOGRAM_SPARSE_SLOWLY for thes
asanka 2015/10/26 14:50:52 Done. You're correct that these enumerations are n
27 }
28 return is_allowed;
29 }
30
31 } // 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