Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |