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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ui/shell_dialogs/selected_file_info.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/shell_dialogs/selected_file_info.h" 5 #include "ui/shell_dialogs/selected_file_info.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 SelectedFileInfo::SelectedFileInfo() {} 9 SelectedFileInfo::SelectedFileInfo() {}
10 10
11 SelectedFileInfo::SelectedFileInfo(const base::FilePath& in_file_path, 11 SelectedFileInfo::SelectedFileInfo(const base::FilePath& in_file_path,
12 const base::FilePath& in_local_path) 12 const base::FilePath& in_local_path)
13 : file_path(in_file_path), 13 : file_path(in_file_path),
14 local_path(in_local_path) { 14 local_path(in_local_path) {
15 display_name = in_file_path.BaseName().value(); 15 SetHideFileExtension(false);
16 } 16 }
17 17
18 SelectedFileInfo::~SelectedFileInfo() {} 18 SelectedFileInfo::~SelectedFileInfo() {}
19 19
20 void SelectedFileInfo::SetHideFileExtension(bool hide_extension) {
21 hide_file_extension = hide_extension;
22 if (hide_file_extension) {
23 display_name = file_path.BaseName().RemoveExtension().value();
24 } else {
25 display_name = file_path.BaseName().value();
26 }
27 }
28
20 } // namespace ui 29 } // namespace ui
OLDNEW
« 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