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 <shlobj.h> | 7 #include <shlobj.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 if (suggested_file_name.value() == L"\\") | 438 if (suggested_file_name.value() == L"\\") |
439 suggested_file_name.clear(); | 439 suggested_file_name.clear(); |
440 } | 440 } |
441 save_as.SetInitialSelection(suggested_directory, suggested_file_name); | 441 save_as.SetInitialSelection(suggested_directory, suggested_file_name); |
442 } | 442 } |
443 | 443 |
444 save_as.GetOPENFILENAME()->lpstrFilter = | 444 save_as.GetOPENFILENAME()->lpstrFilter = |
445 filter.empty() ? NULL : filter.c_str(); | 445 filter.empty() ? NULL : filter.c_str(); |
446 save_as.GetOPENFILENAME()->nFilterIndex = *index; | 446 save_as.GetOPENFILENAME()->nFilterIndex = *index; |
447 save_as.GetOPENFILENAME()->lpstrDefExt = &def_ext[0]; | 447 save_as.GetOPENFILENAME()->lpstrDefExt = &def_ext[0]; |
448 save_as.MaybeInstallWindowPositionHookForSaveAsOnXP(); | |
449 | 448 |
450 if (!get_save_file_name_impl_.Run(save_as.GetOPENFILENAME())) | 449 if (!get_save_file_name_impl_.Run(save_as.GetOPENFILENAME())) |
451 return false; | 450 return false; |
452 | 451 |
453 // Return the user's choice. | 452 // Return the user's choice. |
454 final_name->assign(save_as.GetOPENFILENAME()->lpstrFile); | 453 final_name->assign(save_as.GetOPENFILENAME()->lpstrFile); |
455 *index = save_as.GetOPENFILENAME()->nFilterIndex; | 454 *index = save_as.GetOPENFILENAME()->nFilterIndex; |
456 | 455 |
457 // Figure out what filter got selected. The filter index is 1-based. | 456 // Figure out what filter got selected. The filter index is 1-based. |
458 std::wstring filter_selected; | 457 std::wstring filter_selected; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 | 707 |
709 SelectFileDialog* CreateSelectFileDialog(SelectFileDialog::Listener* listener, | 708 SelectFileDialog* CreateSelectFileDialog(SelectFileDialog::Listener* listener, |
710 SelectFilePolicy* policy) { | 709 SelectFilePolicy* policy) { |
711 return CreateWinSelectFileDialog(listener, | 710 return CreateWinSelectFileDialog(listener, |
712 policy, | 711 policy, |
713 base::Bind(&CallBuiltinGetOpenFileName), | 712 base::Bind(&CallBuiltinGetOpenFileName), |
714 base::Bind(&CallBuiltinGetSaveFileName)); | 713 base::Bind(&CallBuiltinGetSaveFileName)); |
715 } | 714 } |
716 | 715 |
717 } // namespace ui | 716 } // namespace ui |
OLD | NEW |