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 |