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/download/download_file_picker.h" | 5 #include "chrome/browser/download/download_file_picker.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/download/download_prefs.h" | 8 #include "chrome/browser/download/download_prefs.h" |
9 #include "chrome/browser/platform_util.h" | 9 #include "chrome/browser/platform_util.h" |
10 #include "chrome/browser/ui/chrome_select_file_policy.h" | 10 #include "chrome/browser/ui/chrome_select_file_policy.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 file_type_info.extensions.resize(1); | 75 file_type_info.extensions.resize(1); |
76 file_type_info.extensions[0].push_back(extension); | 76 file_type_info.extensions[0].push_back(extension); |
77 } | 77 } |
78 file_type_info.include_all_files = true; | 78 file_type_info.include_all_files = true; |
79 file_type_info.support_drive = true; | 79 file_type_info.support_drive = true; |
80 gfx::NativeWindow owning_window = web_contents ? | 80 gfx::NativeWindow owning_window = web_contents ? |
81 platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()) : | 81 platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()) : |
82 NULL; | 82 NULL; |
83 | 83 |
84 select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_SAVEAS_FILE, | 84 select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_SAVEAS_FILE, |
85 string16(), | 85 base::string16(), |
86 suggested_path_, | 86 suggested_path_, |
87 &file_type_info, | 87 &file_type_info, |
88 0, | 88 0, |
89 base::FilePath::StringType(), | 89 base::FilePath::StringType(), |
90 owning_window, | 90 owning_window, |
91 NULL); | 91 NULL); |
92 } | 92 } |
93 | 93 |
94 DownloadFilePicker::~DownloadFilePicker() { | 94 DownloadFilePicker::~DownloadFilePicker() { |
95 } | 95 } |
(...skipping 17 matching lines...) Expand all Loading... |
113 // Deletes |this| | 113 // Deletes |this| |
114 } | 114 } |
115 | 115 |
116 // static | 116 // static |
117 void DownloadFilePicker::ShowFilePicker(DownloadItem* item, | 117 void DownloadFilePicker::ShowFilePicker(DownloadItem* item, |
118 const base::FilePath& suggested_path, | 118 const base::FilePath& suggested_path, |
119 const FileSelectedCallback& callback) { | 119 const FileSelectedCallback& callback) { |
120 new DownloadFilePicker(item, suggested_path, callback); | 120 new DownloadFilePicker(item, suggested_path, callback); |
121 // DownloadFilePicker deletes itself. | 121 // DownloadFilePicker deletes itself. |
122 } | 122 } |
OLD | NEW |