OLD | NEW |
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/select_file_dialog_win.h" | 5 #include "ui/shell_dialogs/select_file_dialog_win.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 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 return metro_get_save_file_name(ofn) == TRUE; | 80 return metro_get_save_file_name(ofn) == TRUE; |
81 } else { | 81 } else { |
82 return GetSaveFileName(ofn) == TRUE; | 82 return GetSaveFileName(ofn) == TRUE; |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 // Distinguish directories from regular files. | 86 // Distinguish directories from regular files. |
87 bool IsDirectory(const base::FilePath& path) { | 87 bool IsDirectory(const base::FilePath& path) { |
88 base::PlatformFileInfo file_info; | 88 base::PlatformFileInfo file_info; |
89 return file_util::GetFileInfo(path, &file_info) ? | 89 return base::GetFileInfo(path, &file_info) ? |
90 file_info.is_directory : path.EndsWithSeparator(); | 90 file_info.is_directory : path.EndsWithSeparator(); |
91 } | 91 } |
92 | 92 |
93 // Get the file type description from the registry. This will be "Text Document" | 93 // Get the file type description from the registry. This will be "Text Document" |
94 // for .txt files, "JPEG Image" for .jpg files, etc. If the registry doesn't | 94 // for .txt files, "JPEG Image" for .jpg files, etc. If the registry doesn't |
95 // have an entry for the file type, we return false, true if the description was | 95 // have an entry for the file type, we return false, true if the description was |
96 // found. 'file_ext' must be in form ".txt". | 96 // found. 'file_ext' must be in form ".txt". |
97 static bool GetRegistryDescriptionFromExtension(const std::wstring& file_ext, | 97 static bool GetRegistryDescriptionFromExtension(const std::wstring& file_ext, |
98 std::wstring* reg_description) { | 98 std::wstring* reg_description) { |
99 DCHECK(reg_description); | 99 DCHECK(reg_description); |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 return return_value; | 945 return return_value; |
946 } | 946 } |
947 | 947 |
948 SelectFileDialog* CreateWinSelectFileDialog( | 948 SelectFileDialog* CreateWinSelectFileDialog( |
949 SelectFileDialog::Listener* listener, | 949 SelectFileDialog::Listener* listener, |
950 SelectFilePolicy* policy) { | 950 SelectFilePolicy* policy) { |
951 return new SelectFileDialogImpl(listener, policy); | 951 return new SelectFileDialogImpl(listener, policy); |
952 } | 952 } |
953 | 953 |
954 } // namespace ui | 954 } // namespace ui |
OLD | NEW |