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

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

Issue 12084075: SavePackageFilePickerChromeOS should only force MHTML when saving HTML, not when saving text/image/… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r185696 Created 7 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/download/save_page_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/save_package.cc
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index bff3a1ad70561a64c19238de54b70503f6b095c6..6125ea571b81cd36b482f5840a6fe99346f19d22 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -305,6 +305,7 @@ bool SavePackage::Init(
web_contents()->GenerateMHTML(saved_main_file_path_, base::Bind(
&SavePackage::OnMHTMLGenerated, this));
} else {
+ DCHECK_EQ(SAVE_PAGE_TYPE_AS_ONLY_HTML, save_type_) << save_type_;
wait_state_ = NET_FILES;
SaveFileCreateInfo::SaveFileSource save_source = page_url_.SchemeIsFile() ?
SaveFileCreateInfo::SAVE_FILE_FROM_FILE :
@@ -1361,6 +1362,9 @@ void SavePackage::OnPathPicked(
const base::FilePath& final_name,
SavePageType type,
const SavePackageDownloadCreatedCallback& download_created_callback) {
+ DCHECK((type == SAVE_PAGE_TYPE_AS_ONLY_HTML) ||
+ (type == SAVE_PAGE_TYPE_AS_MHTML) ||
+ (type == SAVE_PAGE_TYPE_AS_COMPLETE_HTML)) << type;
// Ensure the filename is safe.
saved_main_file_path_ = final_name;
// TODO(asanka): This call may block on IO and shouldn't be made
« no previous file with comments | « chrome/browser/download/save_page_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698