Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
|
scherkus (not reviewing)
2009/04/17 19:36:41
bump copyright year
| |
| 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.h" | 5 #include "chrome/browser/download/save_package.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.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 "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1014 file_type_info.extension_description_overrides.push_back( | 1014 file_type_info.extension_description_overrides.push_back( |
| 1015 WideToUTF16(l10n_util::GetString(IDS_SAVE_PAGE_DESC_HTML_ONLY))); | 1015 WideToUTF16(l10n_util::GetString(IDS_SAVE_PAGE_DESC_HTML_ONLY))); |
| 1016 file_type_info.extensions[1].push_back(FILE_PATH_LITERAL("htm")); | 1016 file_type_info.extensions[1].push_back(FILE_PATH_LITERAL("htm")); |
| 1017 file_type_info.extension_description_overrides.push_back( | 1017 file_type_info.extension_description_overrides.push_back( |
| 1018 WideToUTF16(l10n_util::GetString(IDS_SAVE_PAGE_DESC_COMPLETE))); | 1018 WideToUTF16(l10n_util::GetString(IDS_SAVE_PAGE_DESC_COMPLETE))); |
| 1019 file_type_info.include_all_files = false; | 1019 file_type_info.include_all_files = false; |
| 1020 default_extension = FILE_PATH_LITERAL("htm"); | 1020 default_extension = FILE_PATH_LITERAL("htm"); |
| 1021 } else { | 1021 } else { |
| 1022 file_type_info.extensions.resize(1); | 1022 file_type_info.extensions.resize(1); |
| 1023 file_type_info.extensions[0].push_back(suggested_path.Extension()); | 1023 file_type_info.extensions[0].push_back(suggested_path.Extension()); |
| 1024 if (!file_type_info.extensions[0][0].empty()) | |
| 1025 file_type_info.extensions[0][0].erase(0, 1); // drop the . | |
|
scherkus (not reviewing)
2009/04/17 19:36:41
I'm not familiar with this code but it looks dupli
Avi (use Gerrit)
2009/04/17 19:43:53
I want FilePath.Extension() to not provide leading
| |
| 1024 file_type_info.include_all_files = true; | 1026 file_type_info.include_all_files = true; |
| 1025 file_type_index = 1; | 1027 file_type_index = 1; |
| 1026 } | 1028 } |
| 1027 | 1029 |
| 1028 if (g_should_prompt_for_filename) { | 1030 if (g_should_prompt_for_filename) { |
| 1029 if (!select_file_dialog_.get()) | 1031 if (!select_file_dialog_.get()) |
| 1030 select_file_dialog_ = SelectFileDialog::Create(this); | 1032 select_file_dialog_ = SelectFileDialog::Create(this); |
| 1031 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE, | 1033 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE, |
| 1032 string16(), | 1034 string16(), |
| 1033 suggested_path, | 1035 suggested_path, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1142 int index, void* params) { | 1144 int index, void* params) { |
| 1143 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1145 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1144 ContinueSave(save_params, path, index); | 1146 ContinueSave(save_params, path, index); |
| 1145 delete save_params; | 1147 delete save_params; |
| 1146 } | 1148 } |
| 1147 | 1149 |
| 1148 void SavePackage::FileSelectionCanceled(void* params) { | 1150 void SavePackage::FileSelectionCanceled(void* params) { |
| 1149 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1151 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1150 delete save_params; | 1152 delete save_params; |
| 1151 } | 1153 } |
| OLD | NEW |