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 "chrome/browser/ui/select_file_dialog.h" | 5 #include "chrome/browser/ui/select_file_dialog.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/infobars/infobar_tab_helper.h" | 11 #include "chrome/browser/infobars/infobar_tab_helper.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" | 13 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" |
14 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "content/public/common/selected_file_info.h" | |
17 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 17 #include "ui/base/dialogs/selected_file_info.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 | 19 |
20 using content::WebContents; | 20 using content::WebContents; |
21 | 21 |
22 SelectFileDialog::FileTypeInfo::FileTypeInfo() : include_all_files(false) {} | 22 SelectFileDialog::FileTypeInfo::FileTypeInfo() : include_all_files(false) {} |
23 | 23 |
24 SelectFileDialog::FileTypeInfo::~FileTypeInfo() {} | 24 SelectFileDialog::FileTypeInfo::~FileTypeInfo() {} |
25 | 25 |
26 void SelectFileDialog::Listener::FileSelectedWithExtraInfo( | 26 void SelectFileDialog::Listener::FileSelectedWithExtraInfo( |
27 const content::SelectedFileInfo& file, | 27 const ui::SelectedFileInfo& file, |
28 int index, | 28 int index, |
29 void* params) { | 29 void* params) { |
30 FileSelected(file.path, index, params); | 30 FileSelected(file.path, index, params); |
31 } | 31 } |
32 | 32 |
33 void SelectFileDialog::Listener::MultiFilesSelectedWithExtraInfo( | 33 void SelectFileDialog::Listener::MultiFilesSelectedWithExtraInfo( |
34 const std::vector<content::SelectedFileInfo>& files, | 34 const std::vector<ui::SelectedFileInfo>& files, |
35 void* params) { | 35 void* params) { |
36 std::vector<FilePath> file_paths; | 36 std::vector<FilePath> file_paths; |
37 for (size_t i = 0; i < files.size(); ++i) | 37 for (size_t i = 0; i < files.size(); ++i) |
38 file_paths.push_back(files[i].path); | 38 file_paths.push_back(files[i].path); |
39 | 39 |
40 MultiFilesSelected(file_paths, params); | 40 MultiFilesSelected(file_paths, params); |
41 } | 41 } |
42 | 42 |
43 SelectFileDialog::SelectFileDialog(Listener* listener) | 43 SelectFileDialog::SelectFileDialog(Listener* listener) |
44 : listener_(listener) { | 44 : listener_(listener) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 | 101 |
102 bool SelectFileDialog::HasMultipleFileTypeChoices() { | 102 bool SelectFileDialog::HasMultipleFileTypeChoices() { |
103 return HasMultipleFileTypeChoicesImpl(); | 103 return HasMultipleFileTypeChoicesImpl(); |
104 } | 104 } |
105 | 105 |
106 void SelectFileDialog::CancelFileSelection(void* params) { | 106 void SelectFileDialog::CancelFileSelection(void* params) { |
107 if (listener_) | 107 if (listener_) |
108 listener_->FileSelectionCanceled(params); | 108 listener_->FileSelectionCanceled(params); |
109 } | 109 } |
OLD | NEW |