Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/common/safe_browsing/download_protection_util.h" | 5 #include "chrome/common/safe_browsing/download_protection_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 EXTENSION_CDR, | 275 EXTENSION_CDR, |
| 276 EXTENSION_DMGPART, | 276 EXTENSION_DMGPART, |
| 277 EXTENSION_DVDR, | 277 EXTENSION_DVDR, |
| 278 EXTENSION_DART, | 278 EXTENSION_DART, |
| 279 EXTENSION_DC42, | 279 EXTENSION_DC42, |
| 280 EXTENSION_DISKCOPY42, | 280 EXTENSION_DISKCOPY42, |
| 281 EXTENSION_IMGPART, | 281 EXTENSION_IMGPART, |
| 282 EXTENSION_NDIF, | 282 EXTENSION_NDIF, |
| 283 EXTENSION_UDIF, | 283 EXTENSION_UDIF, |
| 284 EXTENSION_TOAST, | 284 EXTENSION_TOAST, |
| 285 // NOTE! If you modify this list, you should also update | |
|
Lei Zhang
2016/05/09 23:28:01
Is is possible to enforce this with static_assert?
Nathan Parker
2016/05/10 17:33:51
Done. I'm not actually comparing this list to the
| |
| 286 // chrome/browser/resources/safe_browsing/download_file_types.asciipb | |
| 287 | |
| 285 // New values go above this one. | 288 // New values go above this one. |
| 286 EXTENSION_MAX | 289 EXTENSION_MAX |
| 287 }; | 290 }; |
| 288 | 291 |
| 289 struct SafeBrowsingFiletype { | 292 struct SafeBrowsingFiletype { |
| 290 const base::FilePath::CharType* const extension; | 293 const base::FilePath::CharType* const extension; |
| 291 int uma_value; | 294 int uma_value; |
| 292 bool is_supported_binary; | 295 bool is_supported_binary; |
| 293 bool is_archive; | 296 bool is_archive; |
| 294 }; | 297 }; |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 642 return ClientDownloadRequest::ARCHIVE; | 645 return ClientDownloadRequest::ARCHIVE; |
| 643 return ClientDownloadRequest::WIN_EXECUTABLE; | 646 return ClientDownloadRequest::WIN_EXECUTABLE; |
| 644 } | 647 } |
| 645 | 648 |
| 646 int GetSBClientDownloadExtensionValueForUMA(const base::FilePath& file) { | 649 int GetSBClientDownloadExtensionValueForUMA(const base::FilePath& file) { |
| 647 return GetFileType(file).uma_value; | 650 return GetFileType(file).uma_value; |
| 648 } | 651 } |
| 649 | 652 |
| 650 } // namespace download_protection_util | 653 } // namespace download_protection_util |
| 651 } // namespace safe_browsing | 654 } // namespace safe_browsing |
| OLD | NEW |