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

Unified Diff: ui/shell_dialogs/selected_file_info.cc

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
« no previous file with comments | « ui/shell_dialogs/selected_file_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/shell_dialogs/selected_file_info.cc
diff --git a/ui/shell_dialogs/selected_file_info.cc b/ui/shell_dialogs/selected_file_info.cc
index 054c511e81621f7fb64ab47e014924e50e572248..6e3b9bcc29d2dd4059e1fbb4ccaf1356f23075da 100644
--- a/ui/shell_dialogs/selected_file_info.cc
+++ b/ui/shell_dialogs/selected_file_info.cc
@@ -12,9 +12,18 @@ SelectedFileInfo::SelectedFileInfo(const base::FilePath& in_file_path,
const base::FilePath& in_local_path)
: file_path(in_file_path),
local_path(in_local_path) {
- display_name = in_file_path.BaseName().value();
+ SetHideFileExtension(false);
}
SelectedFileInfo::~SelectedFileInfo() {}
+void SelectedFileInfo::SetHideFileExtension(bool hide_extension) {
+ hide_file_extension = hide_extension;
+ if (hide_file_extension) {
+ display_name = file_path.BaseName().RemoveExtension().value();
+ } else {
+ display_name = file_path.BaseName().value();
+ }
+}
+
} // namespace ui
« no previous file with comments | « ui/shell_dialogs/selected_file_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698