| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "chrome/browser/download/download_extensions.h" | 8 #include "chrome/browser/download/download_extensions.h" |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 {"tcsh", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 491 {"tcsh", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 492 #endif | 492 #endif |
| 493 #if defined(OS_MACOSX) | 493 #if defined(OS_MACOSX) |
| 494 // Automator Action. | 494 // Automator Action. |
| 495 {"action", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 495 {"action", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 496 | 496 |
| 497 {"command", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 497 {"command", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 498 | 498 |
| 499 // Automator Workflow. | 499 // Automator Workflow. |
| 500 {"workflow", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 500 {"workflow", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 501 |
| 502 // Executable file extensions for Mac. |
| 503 {"cdr", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 504 {"dart", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 505 {"dc42", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 506 {"diskcopy42", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 507 {"dmg", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 508 {"dmgpart", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 509 {"dvdr", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 510 {"img", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 511 {"imgpart", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 512 {"ndif", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 513 {"smi", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 514 {"sparsebundle", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 515 {"sparseimage", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 516 {"toast", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 517 {"udif", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 501 #endif | 518 #endif |
| 502 | 519 |
| 503 // Package management formats. OS_WIN package formats are handled above. | 520 // Package management formats. OS_WIN package formats are handled above. |
| 504 #if defined(OS_MACOSX) || defined(OS_LINUX) | 521 #if defined(OS_MACOSX) || defined(OS_LINUX) |
| 505 {"pkg", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 522 {"pkg", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 506 #endif | 523 #endif |
| 507 #if defined(OS_LINUX) | 524 #if defined(OS_LINUX) |
| 508 {"deb", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 525 {"deb", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 509 {"pet", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 526 {"pet", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| 510 {"pup", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, | 527 {"pup", ALLOW_ON_USER_GESTURE, DISALLOW_AUTO_OPEN}, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 573 |
| 557 DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) { | 574 DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) { |
| 558 return GetFileType(path).danger_level; | 575 return GetFileType(path).danger_level; |
| 559 } | 576 } |
| 560 | 577 |
| 561 bool IsAllowedToOpenAutomatically(const base::FilePath& path) { | 578 bool IsAllowedToOpenAutomatically(const base::FilePath& path) { |
| 562 return GetFileType(path).auto_open_hint == ALLOW_AUTO_OPEN; | 579 return GetFileType(path).auto_open_hint == ALLOW_AUTO_OPEN; |
| 563 } | 580 } |
| 564 | 581 |
| 565 } // namespace download_util | 582 } // namespace download_util |
| OLD | NEW |