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

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

Issue 27106: Get save page working on posix. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « chrome/browser/browser.cc ('k') | webkit/glue/dom_serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/save_package.cc
===================================================================
--- chrome/browser/download/save_package.cc (revision 10273)
+++ chrome/browser/download/save_package.cc (working copy)
@@ -267,12 +267,12 @@
}
// Create the fake DownloadItem and display the view.
-#if defined(OS_WIN)
- // TODO(port): We need to do something like this on posix, but avoid
- // using DownloadShelfView, which probably should not be ported directly.
download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_,
FilePath(), Time::Now(), 0, -1, -1, false);
download_->set_manager(web_contents_->profile()->GetDownloadManager());
+#if defined(OS_WIN)
+ // TODO(port): We need to do something like this on posix, but avoid
+ // using DownloadShelfView, which probably should not be ported directly.
DownloadShelfView* shelf = web_contents_->GetDownloadShelfView();
shelf->AddDownloadView(new DownloadItemView(
download_, shelf, new SavePageModel(this, download_)));
@@ -561,7 +561,6 @@
wait_state_ = FAILED;
// Inform the DownloadItem we have canceled whole save page job.
- DCHECK(download_);
download_->Cancel(false);
}
@@ -612,7 +611,6 @@
&SaveFileManager::RemoveSavedFileFromFileMap,
save_ids));
- DCHECK(download_);
download_->Finished(all_save_items_count_);
}
@@ -632,7 +630,6 @@
PutInProgressItemToSavedMap(save_item);
// Inform the DownloadItem to update UI.
- DCHECK(download_);
// We use the received bytes as number of saved files.
download_->Update(completed_count());
@@ -674,7 +671,6 @@
PutInProgressItemToSavedMap(save_item);
// Inform the DownloadItem to update UI.
- DCHECK(download_);
// We use the received bytes as number of saved files.
download_->Update(completed_count());
@@ -992,6 +988,7 @@
// TODO(port): we need a version of ReplaceIllegalCharacters() that takes
// FilePaths.
file_util::ReplaceIllegalCharacters(&file_name, L' ');
+ TrimWhitespace(file_name, TRIM_ALL, &file_name);
FilePath suggest_name = FilePath::FromWStringHack(save_file_path.GetValue());
suggest_name = suggest_name.Append(FilePath::FromWStringHack(file_name));
@@ -1041,7 +1038,6 @@
index = 1;
}
- DCHECK(download_manager);
// Ensure the filename is safe.
download_manager->GenerateSafeFilename(param->current_tab_mime_type,
&param->saved_main_file_path);
« no previous file with comments | « chrome/browser/browser.cc ('k') | webkit/glue/dom_serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698