| OLD | NEW |
| (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 |
| OLD | NEW |