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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 const std::wstring& filter, | 761 const std::wstring& filter, |
762 HWND owner, | 762 HWND owner, |
763 std::vector<FilePath>* paths) { | 763 std::vector<FilePath>* paths) { |
764 OPENFILENAME ofn; | 764 OPENFILENAME ofn; |
765 // We must do this otherwise the ofn's FlagsEx may be initialized to random | 765 // We must do this otherwise the ofn's FlagsEx may be initialized to random |
766 // junk in release builds which can cause the Places Bar not to show up! | 766 // junk in release builds which can cause the Places Bar not to show up! |
767 ZeroMemory(&ofn, sizeof(ofn)); | 767 ZeroMemory(&ofn, sizeof(ofn)); |
768 ofn.lStructSize = sizeof(ofn); | 768 ofn.lStructSize = sizeof(ofn); |
769 ofn.hwndOwner = owner; | 769 ofn.hwndOwner = owner; |
770 | 770 |
771 scoped_array<wchar_t> filename(new wchar_t[UNICODE_STRING_MAX_CHARS]); | 771 scoped_ptr<wchar_t[]> filename(new wchar_t[UNICODE_STRING_MAX_CHARS]); |
772 filename[0] = 0; | 772 filename[0] = 0; |
773 | 773 |
774 ofn.lpstrFile = filename.get(); | 774 ofn.lpstrFile = filename.get(); |
775 ofn.nMaxFile = UNICODE_STRING_MAX_CHARS; | 775 ofn.nMaxFile = UNICODE_STRING_MAX_CHARS; |
776 // We use OFN_NOCHANGEDIR so that the user can rename or delete the directory | 776 // We use OFN_NOCHANGEDIR so that the user can rename or delete the directory |
777 // without having to close Chrome first. | 777 // without having to close Chrome first. |
778 ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_EXPLORER | 778 ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_EXPLORER |
779 | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT; | 779 | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT; |
780 | 780 |
781 if (!filter.empty()) { | 781 if (!filter.empty()) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 return return_value; | 855 return return_value; |
856 } | 856 } |
857 | 857 |
858 SelectFileDialog* CreateWinSelectFileDialog( | 858 SelectFileDialog* CreateWinSelectFileDialog( |
859 SelectFileDialog::Listener* listener, | 859 SelectFileDialog::Listener* listener, |
860 SelectFilePolicy* policy) { | 860 SelectFilePolicy* policy) { |
861 return new SelectFileDialogImpl(listener, policy); | 861 return new SelectFileDialogImpl(listener, policy); |
862 } | 862 } |
863 | 863 |
864 } // namespace ui | 864 } // namespace ui |
OLD | NEW |