Index: content/browser/download/file_metadata_mac.mm |
diff --git a/content/browser/download/file_metadata_mac.mm b/content/browser/download/file_metadata_mac.mm |
index f4ae3c9750943adc0b88b14dfeafde35f09be680..02bb755444bd609be69543c440467b313de40379 100644 |
--- a/content/browser/download/file_metadata_mac.mm |
+++ b/content/browser/download/file_metadata_mac.mm |
@@ -166,4 +166,18 @@ void AddQuarantineMetadataToFile(const base::FilePath& file, const GURL& source, |
} |
} |
+void SetExtensionHiddenForFile(const base::FilePath& file, bool hidden) { |
+ NSString* filePath = |
+ [NSString stringWithUTF8String:file.value().c_str()]; |
+ if (filePath) { |
+ NSNumber* boolNumber = [NSNumber numberWithBool:hidden ? YES : NO]; |
Avi (use Gerrit)
2015/12/12 00:41:46
bool ? YES : NO is not useful; bools convert as 1
shrike
2015/12/16 19:04:12
Acknowledged.
|
+ NSDictionary* attributes = |
+ [NSDictionary dictionaryWithObject:boolNumber |
+ forKey:NSFileExtensionHidden]; |
Avi (use Gerrit)
2015/12/12 00:41:46
NSDictionary* attributes = @{ NSFileExtensionHidde
shrike
2015/12/16 19:04:12
Done.
|
+ [[NSFileManager defaultManager] setAttributes:attributes |
+ ofItemAtPath:filePath |
+ error:nullptr]; |
+ } |
+} |
+ |
} // namespace content |