OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/shell_dialogs.h" | 5 #include "chrome/browser/ui/shell_dialogs.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <commdlg.h> | 8 #include <commdlg.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <set> | 12 #include <set> |
13 | 13 |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/i18n/case_conversion.h" | 16 #include "base/i18n/case_conversion.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "base/string_split.h" | 18 #include "base/string_split.h" |
19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
21 #include "base/win/registry.h" | 21 #include "base/win/registry.h" |
22 #include "base/win/scoped_comptr.h" | 22 #include "base/win/scoped_comptr.h" |
23 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
24 #include "content/browser/browser_thread.h" | 24 #include "content/browser/browser_thread.h" |
25 #include "grit/app_strings.h" | |
26 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "grit/ui_strings.h" |
27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
28 | 28 |
29 // This function takes the output of a SaveAs dialog: a filename, a filter and | 29 // This function takes the output of a SaveAs dialog: a filename, a filter and |
30 // the extension originally suggested to the user (shown in the dialog box) and | 30 // the extension originally suggested to the user (shown in the dialog box) and |
31 // returns back the filename with the appropriate extension tacked on. If the | 31 // returns back the filename with the appropriate extension tacked on. If the |
32 // user requests an unknown extension and is not using the 'All files' filter, | 32 // user requests an unknown extension and is not using the 'All files' filter, |
33 // the suggested extension will be appended, otherwise we will leave the | 33 // the suggested extension will be appended, otherwise we will leave the |
34 // filename unmodified. |filename| should contain the filename selected in the | 34 // filename unmodified. |filename| should contain the filename selected in the |
35 // SaveAs dialog box and may include the path, |filter_selected| should be | 35 // SaveAs dialog box and may include the path, |filter_selected| should be |
36 // '*.something', for example '*.*' or it can be blank (which is treated as | 36 // '*.something', for example '*.*' or it can be blank (which is treated as |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 } | 933 } |
934 } | 934 } |
935 } | 935 } |
936 return success; | 936 return success; |
937 } | 937 } |
938 | 938 |
939 // static | 939 // static |
940 SelectFileDialog* SelectFileDialog::Create(Listener* listener) { | 940 SelectFileDialog* SelectFileDialog::Create(Listener* listener) { |
941 return new SelectFileDialogImpl(listener); | 941 return new SelectFileDialogImpl(listener); |
942 } | 942 } |
OLD | NEW |