| 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/save_package_file_picker.h" | 5 #include "chrome/browser/download/save_package_file_picker.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 file_type_info.include_all_files = true; | 199 file_type_info.include_all_files = true; |
| 200 file_type_index = 1; | 200 file_type_index = 1; |
| 201 } | 201 } |
| 202 | 202 |
| 203 if (g_should_prompt_for_filename) { | 203 if (g_should_prompt_for_filename) { |
| 204 select_file_dialog_ = ui::SelectFileDialog::Create( | 204 select_file_dialog_ = ui::SelectFileDialog::Create( |
| 205 this, new ChromeSelectFilePolicy(web_contents)); | 205 this, new ChromeSelectFilePolicy(web_contents)); |
| 206 select_file_dialog_->SelectFile( | 206 select_file_dialog_->SelectFile( |
| 207 ui::SelectFileDialog::SELECT_SAVEAS_FILE, | 207 ui::SelectFileDialog::SELECT_SAVEAS_FILE, |
| 208 string16(), | 208 base::string16(), |
| 209 suggested_path_copy, | 209 suggested_path_copy, |
| 210 &file_type_info, | 210 &file_type_info, |
| 211 file_type_index, | 211 file_type_index, |
| 212 default_extension_copy, | 212 default_extension_copy, |
| 213 platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()), | 213 platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()), |
| 214 NULL); | 214 NULL); |
| 215 } else { | 215 } else { |
| 216 // Just use 'suggested_path_copy' instead of opening the dialog prompt. | 216 // Just use 'suggested_path_copy' instead of opening the dialog prompt. |
| 217 // Go through FileSelected() for consistency. | 217 // Go through FileSelected() for consistency. |
| 218 FileSelected(suggested_path_copy, file_type_index, NULL); | 218 FileSelected(suggested_path_copy, file_type_index, NULL); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 280 } |
| 281 #endif | 281 #endif |
| 282 | 282 |
| 283 callback_.Run(path_copy, save_type, | 283 callback_.Run(path_copy, save_type, |
| 284 base::Bind(&OnSavePackageDownloadCreated)); | 284 base::Bind(&OnSavePackageDownloadCreated)); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void SavePackageFilePicker::FileSelectionCanceled(void* unused_params) { | 287 void SavePackageFilePicker::FileSelectionCanceled(void* unused_params) { |
| 288 delete this; | 288 delete this; |
| 289 } | 289 } |
| OLD | NEW |