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/download/save_package_file_picker.h" | 5 #include "chrome/browser/download/save_package_file_picker.h" |
6 | 6 |
7 #include "chrome/browser/download/download_manager.h" | 7 #include "chrome/browser/download/download_manager.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/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 0, IDS_SAVE_PAGE_DESC_HTML_ONLY, IDS_SAVE_PAGE_DESC_COMPLETE, | 45 0, IDS_SAVE_PAGE_DESC_HTML_ONLY, IDS_SAVE_PAGE_DESC_COMPLETE, |
46 }; | 46 }; |
47 | 47 |
48 } | 48 } |
49 | 49 |
50 SavePackageFilePicker::SavePackageFilePicker( | 50 SavePackageFilePicker::SavePackageFilePicker( |
51 const base::WeakPtr<SavePackage>& save_package, | 51 const base::WeakPtr<SavePackage>& save_package, |
52 const FilePath& suggested_path, | 52 const FilePath& suggested_path, |
53 bool can_save_as_complete) | 53 bool can_save_as_complete) |
54 : save_package_(save_package) { | 54 : save_package_(save_package) { |
55 DownloadPrefs* download_prefs = save_package->tab_contents()->profile()-> | 55 DownloadPrefs* download_prefs = save_package->tab_contents()->context()-> |
56 GetDownloadManager()->download_prefs(); | 56 GetDownloadManager()->download_prefs(); |
57 int file_type_index = SavePackageTypeToIndex( | 57 int file_type_index = SavePackageTypeToIndex( |
58 static_cast<SavePackage::SavePackageType>( | 58 static_cast<SavePackage::SavePackageType>( |
59 download_prefs->save_file_type())); | 59 download_prefs->save_file_type())); |
60 DCHECK_NE(-1, file_type_index); | 60 DCHECK_NE(-1, file_type_index); |
61 | 61 |
62 SelectFileDialog::FileTypeInfo file_type_info; | 62 SelectFileDialog::FileTypeInfo file_type_info; |
63 FilePath::StringType default_extension; | 63 FilePath::StringType default_extension; |
64 | 64 |
65 // If the contents can not be saved as complete-HTML, do not show the | 65 // If the contents can not be saved as complete-HTML, do not show the |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 index <= kSelectFileCompleteIndex); | 150 index <= kSelectFileCompleteIndex); |
151 | 151 |
152 if (save_package_) | 152 if (save_package_) |
153 save_package_->OnPathPicked(path, kIndexToSaveType[index]); | 153 save_package_->OnPathPicked(path, kIndexToSaveType[index]); |
154 delete this; | 154 delete this; |
155 } | 155 } |
156 | 156 |
157 void SavePackageFilePicker::FileSelectionCanceled(void* params) { | 157 void SavePackageFilePicker::FileSelectionCanceled(void* params) { |
158 delete this; | 158 delete this; |
159 } | 159 } |
OLD | NEW |