| Index: chrome/common/safe_browsing/file_type_policies.cc
|
| diff --git a/chrome/common/safe_browsing/file_type_policies.cc b/chrome/common/safe_browsing/file_type_policies.cc
|
| index 01db9dab3876cab8e7002a03078d4df2e5a98000..cf9e4418b853e13033686b366b4c2f5e1300d471 100644
|
| --- a/chrome/common/safe_browsing/file_type_policies.cc
|
| +++ b/chrome/common/safe_browsing/file_type_policies.cc
|
| @@ -209,4 +209,21 @@ bool FileTypePolicies::IsCheckedBinaryFile(const base::FilePath& file) const {
|
| return PolicyForExtension(ext).ping_setting() == DownloadFileType::FULL_PING;
|
| }
|
|
|
| +bool FileTypePolicies::IsAllowedToOpenAutomatically(
|
| + const base::FilePath& file) const {
|
| + const std::string ext = CanonicalizedExtension(file);
|
| + if (ext.empty())
|
| + return false;
|
| + AutoLock lock(lock_);
|
| + return PolicyForExtension(ext).platform_settings(0).auto_open_hint() ==
|
| + DownloadFileType::ALLOW_AUTO_OPEN;
|
| +}
|
| +
|
| +DownloadFileType::DangerLevel FileTypePolicies::GetFileDangerLevel(
|
| + const base::FilePath& file) const {
|
| + const std::string ext = CanonicalizedExtension(file);
|
| + AutoLock lock(lock_);
|
| + return PolicyForExtension(ext).platform_settings(0).danger_level();
|
| +}
|
| +
|
| } // namespace safe_browsing
|
|
|