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/base/dialogs/select_file_dialog_win.h" | 5 #include "ui/base/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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 // Use old way if we don't get what we want. | 679 // Use old way if we don't get what we want. |
680 wchar_t old_out_dir_buffer[MAX_PATH + 1]; | 680 wchar_t old_out_dir_buffer[MAX_PATH + 1]; |
681 if (SHGetPathFromIDList(list, old_out_dir_buffer)) { | 681 if (SHGetPathFromIDList(list, old_out_dir_buffer)) { |
682 *path = FilePath(old_out_dir_buffer); | 682 *path = FilePath(old_out_dir_buffer); |
683 result = true; | 683 result = true; |
684 } | 684 } |
685 } | 685 } |
686 | 686 |
687 // According to MSDN, win2000 will not resolve shortcuts, so we do it | 687 // According to MSDN, win2000 will not resolve shortcuts, so we do it |
688 // ourself. | 688 // ourself. |
689 file_util::ResolveShortcut(path); | 689 file_util::ResolveShortcut(*path, path, NULL); |
690 } | 690 } |
691 CoTaskMemFree(list); | 691 CoTaskMemFree(list); |
692 } | 692 } |
693 return result; | 693 return result; |
694 } | 694 } |
695 | 695 |
696 bool SelectFileDialogImpl::RunOpenFileDialog( | 696 bool SelectFileDialogImpl::RunOpenFileDialog( |
697 const std::wstring& title, | 697 const std::wstring& title, |
698 const std::wstring& filter, | 698 const std::wstring& filter, |
699 HWND owner, | 699 HWND owner, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 return return_value; | 847 return return_value; |
848 } | 848 } |
849 | 849 |
850 SelectFileDialog* CreateWinSelectFileDialog( | 850 SelectFileDialog* CreateWinSelectFileDialog( |
851 SelectFileDialog::Listener* listener, | 851 SelectFileDialog::Listener* listener, |
852 SelectFilePolicy* policy) { | 852 SelectFilePolicy* policy) { |
853 return new SelectFileDialogImpl(listener, policy); | 853 return new SelectFileDialogImpl(listener, policy); |
854 } | 854 } |
855 | 855 |
856 } // namespace ui | 856 } // namespace ui |
OLD | NEW |