OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 BrowserThread::PostTask( | 636 BrowserThread::PostTask( |
637 BrowserThread::FILE, FROM_HERE, | 637 BrowserThread::FILE, FROM_HERE, |
638 NewRunnableMethod(file_manager_, | 638 NewRunnableMethod(file_manager_, |
639 &SaveFileManager::RemoveSavedFileFromFileMap, | 639 &SaveFileManager::RemoveSavedFileFromFileMap, |
640 save_ids)); | 640 save_ids)); |
641 | 641 |
642 finished_ = true; | 642 finished_ = true; |
643 wait_state_ = FAILED; | 643 wait_state_ = FAILED; |
644 | 644 |
645 // Inform the DownloadItem we have canceled whole save page job. | 645 // Inform the DownloadItem we have canceled whole save page job. |
646 download_->Cancel(false); | 646 download_->Cancel(); |
647 } | 647 } |
648 | 648 |
649 void SavePackage::CheckFinish() { | 649 void SavePackage::CheckFinish() { |
650 if (in_process_count() || finished_) | 650 if (in_process_count() || finished_) |
651 return; | 651 return; |
652 | 652 |
653 FilePath dir = (save_type_ == SAVE_AS_COMPLETE_HTML && | 653 FilePath dir = (save_type_ == SAVE_AS_COMPLETE_HTML && |
654 saved_success_items_.size() > 1) ? | 654 saved_success_items_.size() > 1) ? |
655 saved_main_directory_path_ : FilePath(); | 655 saved_main_directory_path_ : FilePath(); |
656 | 656 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 bool SavePackage::IsSavableContents(const std::string& contents_mime_type) { | 1320 bool SavePackage::IsSavableContents(const std::string& contents_mime_type) { |
1321 // WebKit creates Document object when MIME type is application/xhtml+xml, | 1321 // WebKit creates Document object when MIME type is application/xhtml+xml, |
1322 // so we also support this MIME type. | 1322 // so we also support this MIME type. |
1323 return contents_mime_type == "text/html" || | 1323 return contents_mime_type == "text/html" || |
1324 contents_mime_type == "text/xml" || | 1324 contents_mime_type == "text/xml" || |
1325 contents_mime_type == "application/xhtml+xml" || | 1325 contents_mime_type == "application/xhtml+xml" || |
1326 contents_mime_type == "text/plain" || | 1326 contents_mime_type == "text/plain" || |
1327 contents_mime_type == "text/css" || | 1327 contents_mime_type == "text/css" || |
1328 net::IsSupportedJavascriptMimeType(contents_mime_type.c_str()); | 1328 net::IsSupportedJavascriptMimeType(contents_mime_type.c_str()); |
1329 } | 1329 } |
OLD | NEW |