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/shell_dialogs.h" | 5 #include "chrome/browser/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 |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 params.file_types.include_all_files); | 691 params.file_types.include_all_files); |
692 | 692 |
693 FilePath path = params.default_path; | 693 FilePath path = params.default_path; |
694 bool success = false; | 694 bool success = false; |
695 unsigned filter_index = params.file_type_index; | 695 unsigned filter_index = params.file_type_index; |
696 if (params.type == SELECT_FOLDER) { | 696 if (params.type == SELECT_FOLDER) { |
697 success = RunSelectFolderDialog(params.title, | 697 success = RunSelectFolderDialog(params.title, |
698 params.run_state.owner, | 698 params.run_state.owner, |
699 &path); | 699 &path); |
700 } else if (params.type == SELECT_SAVEAS_FILE) { | 700 } else if (params.type == SELECT_SAVEAS_FILE) { |
701 std::wstring path_as_wstring = path.ToWStringHack(); | 701 std::wstring path_as_wstring = path.value(); |
702 success = SaveFileAsWithFilter(params.run_state.owner, | 702 success = SaveFileAsWithFilter(params.run_state.owner, |
703 params.default_path.ToWStringHack(), filter, | 703 params.default_path.value(), filter, |
704 params.default_extension, false, &filter_index, &path_as_wstring); | 704 params.default_extension, false, &filter_index, &path_as_wstring); |
705 if (success) { | 705 if (success) |
706 path = FilePath::FromWStringHack(path_as_wstring); | 706 path = FilePath(path_as_wstring); |
707 } | |
708 DisableOwner(params.run_state.owner); | 707 DisableOwner(params.run_state.owner); |
709 } else if (params.type == SELECT_OPEN_FILE) { | 708 } else if (params.type == SELECT_OPEN_FILE) { |
710 success = RunOpenFileDialog(params.title, filter, | 709 success = RunOpenFileDialog(params.title, filter, |
711 params.run_state.owner, &path); | 710 params.run_state.owner, &path); |
712 } else if (params.type == SELECT_OPEN_MULTI_FILE) { | 711 } else if (params.type == SELECT_OPEN_MULTI_FILE) { |
713 std::vector<FilePath> paths; | 712 std::vector<FilePath> paths; |
714 if (RunOpenMultiFileDialog(params.title, filter, | 713 if (RunOpenMultiFileDialog(params.title, filter, |
715 params.run_state.owner, &paths)) { | 714 params.run_state.owner, &paths)) { |
716 BrowserThread::PostTask( | 715 BrowserThread::PostTask( |
717 BrowserThread::UI, FROM_HERE, | 716 BrowserThread::UI, FROM_HERE, |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { | 1121 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { |
1123 if (listener_) | 1122 if (listener_) |
1124 listener_->FontSelectionCanceled(params); | 1123 listener_->FontSelectionCanceled(params); |
1125 EndRun(run_state); | 1124 EndRun(run_state); |
1126 } | 1125 } |
1127 | 1126 |
1128 // static | 1127 // static |
1129 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { | 1128 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { |
1130 return new SelectFontDialogImpl(listener); | 1129 return new SelectFontDialogImpl(listener); |
1131 } | 1130 } |
OLD | NEW |