| Index: content/browser/download/save_package.cc
|
| diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
|
| index 8670bb831d5395cbdcddd3059dd57f8175d07f4f..3280b352422e5cbfc85c3722e6f3c9f36bc00b3f 100644
|
| --- a/content/browser/download/save_package.cc
|
| +++ b/content/browser/download/save_package.cc
|
| @@ -263,15 +263,14 @@ bool SavePackage::Init() {
|
| wait_state_ = START_PROCESS;
|
|
|
| // Initialize the request context and resource dispatcher.
|
| - Profile* profile = tab_contents()->profile();
|
| + Profile* profile = static_cast<Profile*>(tab_contents()->context());
|
| if (!profile) {
|
| NOTREACHED();
|
| return false;
|
| }
|
|
|
| // Create the fake DownloadItem and display the view.
|
| - DownloadManager* download_manager =
|
| - tab_contents()->profile()->GetDownloadManager();
|
| + DownloadManager* download_manager = profile->GetDownloadManager();
|
| download_ = new DownloadItem(download_manager,
|
| saved_main_file_path_,
|
| page_url_,
|
| @@ -820,7 +819,7 @@ void SavePackage::SaveNextFile(bool process_all_remaining_items) {
|
| routing_id(),
|
| save_item->save_source(),
|
| save_item->full_path(),
|
| - tab_contents()->profile()->GetResourceContext(),
|
| + tab_contents()->context()->GetResourceContext(),
|
| this);
|
| } while (process_all_remaining_items && waiting_item_queue_.size());
|
| }
|
| @@ -1207,7 +1206,8 @@ FilePath SavePackage::GetSaveDirPreference(PrefService* prefs) {
|
| void SavePackage::GetSaveInfo() {
|
| // Can't use tab_contents_ in the file thread, so get the data that we need
|
| // before calling to it.
|
| - PrefService* prefs = tab_contents()->profile()->GetPrefs();
|
| + Profile* profile = static_cast<Profile*>(tab_contents()->context());
|
| + PrefService* prefs = profile->GetPrefs();
|
| FilePath website_save_dir = GetSaveDirPreference(prefs);
|
| FilePath download_save_dir = prefs->GetFilePath(
|
| prefs::kDownloadDefaultDirectory);
|
| @@ -1283,7 +1283,8 @@ void SavePackage::OnPathPicked(const FilePath& final_name,
|
|
|
| saved_main_directory_path_ = saved_main_file_path_.DirName();
|
|
|
| - PrefService* prefs = tab_contents()->profile()->GetPrefs();
|
| + Profile* profile = static_cast<Profile*>(tab_contents()->context());
|
| + PrefService* prefs = profile->GetPrefs();
|
| StringPrefMember save_file_path;
|
| save_file_path.Init(prefs::kSaveFileDefaultDirectory, prefs, NULL);
|
| #if defined(OS_POSIX)
|
| @@ -1293,7 +1294,7 @@ void SavePackage::OnPathPicked(const FilePath& final_name,
|
| #endif
|
| // If user change the default saving directory, we will remember it just
|
| // like IE and FireFox.
|
| - if (!tab_contents()->profile()->IsOffTheRecord() &&
|
| + if (!tab_contents()->context()->IsOffTheRecord() &&
|
| save_file_path.GetValue() != path_string) {
|
| save_file_path.SetValue(path_string);
|
| }
|
|
|