OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/download/save_package.h" | 5 #include "content/browser/download/save_package.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
331 // Confirm above didn't delete the tab out from under us. | 331 // Confirm above didn't delete the tab out from under us. |
332 if (!download_created_callback.is_null()) | 332 if (!download_created_callback.is_null()) |
333 download_created_callback.Run(download_); | 333 download_created_callback.Run(download_); |
334 | 334 |
335 // Check save type and process the save page job. | 335 // Check save type and process the save page job. |
336 if (save_type_ == SAVE_PAGE_TYPE_AS_COMPLETE_HTML) { | 336 if (save_type_ == SAVE_PAGE_TYPE_AS_COMPLETE_HTML) { |
337 // Get directory | 337 // Get directory |
338 DCHECK(!saved_main_directory_path_.empty()); | 338 DCHECK(!saved_main_directory_path_.empty()); |
339 GetSavableResourceLinks(); | 339 GetSavableResourceLinks(); |
340 } else if (save_type_ == SAVE_PAGE_TYPE_AS_MHTML) { | 340 } else if (save_type_ == SAVE_PAGE_TYPE_AS_MHTML) { |
341 web_contents()->GenerateMHTML(saved_main_file_path_, base::Bind( | 341 web_contents()->GenerateMHTML( |
342 &SavePackage::OnMHTMLGenerated, this)); | 342 saved_main_file_path_, /* use_binary_encoding = */ false, |
nasko
2016/04/20 17:01:15
nit: Comment for the name of parameter should go a
dewittj
2016/04/20 20:20:59
I will make the change, but there isn't anywhere i
nasko
2016/04/20 22:22:38
I'm going with consistency across code in content/
| |
343 base::Bind(&SavePackage::OnMHTMLGenerated, this)); | |
343 } else { | 344 } else { |
344 DCHECK_EQ(SAVE_PAGE_TYPE_AS_ONLY_HTML, save_type_); | 345 DCHECK_EQ(SAVE_PAGE_TYPE_AS_ONLY_HTML, save_type_); |
345 wait_state_ = NET_FILES; | 346 wait_state_ = NET_FILES; |
346 SaveFileCreateInfo::SaveFileSource save_source = page_url_.SchemeIsFile() ? | 347 SaveFileCreateInfo::SaveFileSource save_source = page_url_.SchemeIsFile() ? |
347 SaveFileCreateInfo::SAVE_FILE_FROM_FILE : | 348 SaveFileCreateInfo::SAVE_FILE_FROM_FILE : |
348 SaveFileCreateInfo::SAVE_FILE_FROM_NET; | 349 SaveFileCreateInfo::SAVE_FILE_FROM_NET; |
349 // Add this item to waiting list. | 350 // Add this item to waiting list. |
350 waiting_item_queue_.push_back( | 351 waiting_item_queue_.push_back( |
351 new SaveItem(page_url_, Referrer(), this, save_source, | 352 new SaveItem(page_url_, Referrer(), this, save_source, |
352 FrameTreeNode::kFrameTreeNodeInvalidId)); | 353 FrameTreeNode::kFrameTreeNodeInvalidId)); |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1493 } | 1494 } |
1494 | 1495 |
1495 void SavePackage::FinalizeDownloadEntry() { | 1496 void SavePackage::FinalizeDownloadEntry() { |
1496 DCHECK(download_); | 1497 DCHECK(download_); |
1497 | 1498 |
1498 download_manager_->OnSavePackageSuccessfullyFinished(download_); | 1499 download_manager_->OnSavePackageSuccessfullyFinished(download_); |
1499 StopObservation(); | 1500 StopObservation(); |
1500 } | 1501 } |
1501 | 1502 |
1502 } // namespace content | 1503 } // namespace content |
OLD | NEW |