Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: content/browser/download/file_metadata_mac.mm

Issue 1513413002: Enable "Hide Extension" option when "Save Link As" on the Mac Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..79e9724d1f31b50636da687d2b0c26c0bdbbeec5 100644
--- a/content/browser/download/file_metadata_mac.mm
+++ b/content/browser/download/file_metadata_mac.mm
@@ -166,4 +166,15 @@ 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) {
+ NSDictionary* attributes = @{ NSFileExtensionHidden : @(hidden) };
+ [[NSFileManager defaultManager] setAttributes:attributes
+ ofItemAtPath:filePath
+ error:nullptr];
+ }
+}
+
} // namespace content
« no previous file with comments | « content/browser/download/file_metadata_mac.h ('k') | content/browser/download/file_metadata_unittest_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698