Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1982)

Unified Diff: content/browser/download/save_package.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..a3f38a24cdc8c8b2cdecb7c7967467fcafb715a2 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()->browser_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,8 @@ void SavePackage::SaveNextFile(bool process_all_remaining_items) {
routing_id(),
save_item->save_source(),
save_item->full_path(),
- tab_contents()->profile()->GetResourceContext(),
+ tab_contents()->browser_context()->
+ GetResourceContext(),
this);
} while (process_all_remaining_items && waiting_item_queue_.size());
}
@@ -1207,7 +1207,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()->browser_context());
+ PrefService* prefs = profile->GetPrefs();
FilePath website_save_dir = GetSaveDirPreference(prefs);
FilePath download_save_dir = prefs->GetFilePath(
prefs::kDownloadDefaultDirectory);
@@ -1283,7 +1284,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()->browser_context());
+ PrefService* prefs = profile->GetPrefs();
StringPrefMember save_file_path;
save_file_path.Init(prefs::kSaveFileDefaultDirectory, prefs, NULL);
#if defined(OS_POSIX)
@@ -1293,7 +1295,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()->browser_context()->IsOffTheRecord() &&
save_file_path.GetValue() != path_string) {
save_file_path.SetValue(path_string);
}

Powered by Google App Engine
This is Rietveld 408576698