| 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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 saved_main_directory_path_ = saved_main_directory_path_.Append( | 1231 saved_main_directory_path_ = saved_main_directory_path_.Append( |
| 1232 saved_main_file_path_.RemoveExtension().BaseName().value() + | 1232 saved_main_file_path_.RemoveExtension().BaseName().value() + |
| 1233 FILE_PATH_LITERAL("_files")); | 1233 FILE_PATH_LITERAL("_files")); |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 Init(); | 1236 Init(); |
| 1237 } | 1237 } |
| 1238 | 1238 |
| 1239 // Static | 1239 // Static |
| 1240 bool SavePackage::IsSavableURL(const GURL& url) { | 1240 bool SavePackage::IsSavableURL(const GURL& url) { |
| 1241 for (int i = 0; chrome::kSavableSchemes[i] != NULL; ++i) { | 1241 for (int i = 0; chrome::GetSavableSchemes()[i] != NULL; ++i) { |
| 1242 if (url.SchemeIs(chrome::kSavableSchemes[i])) { | 1242 if (url.SchemeIs(chrome::GetSavableSchemes()[i])) { |
| 1243 return true; | 1243 return true; |
| 1244 } | 1244 } |
| 1245 } | 1245 } |
| 1246 return false; | 1246 return false; |
| 1247 } | 1247 } |
| 1248 | 1248 |
| 1249 // Static | 1249 // Static |
| 1250 bool SavePackage::IsSavableContents(const std::string& contents_mime_type) { | 1250 bool SavePackage::IsSavableContents(const std::string& contents_mime_type) { |
| 1251 // WebKit creates Document object when MIME type is application/xhtml+xml, | 1251 // WebKit creates Document object when MIME type is application/xhtml+xml, |
| 1252 // so we also support this MIME type. | 1252 // so we also support this MIME type. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1277 StopObservation(); | 1277 StopObservation(); |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 void SavePackage::FinalizeDownloadEntry() { | 1280 void SavePackage::FinalizeDownloadEntry() { |
| 1281 DCHECK(download_); | 1281 DCHECK(download_); |
| 1282 DCHECK(download_manager_); | 1282 DCHECK(download_manager_); |
| 1283 | 1283 |
| 1284 download_manager_->SavePageDownloadFinished(download_); | 1284 download_manager_->SavePageDownloadFinished(download_); |
| 1285 StopObservation(); | 1285 StopObservation(); |
| 1286 } | 1286 } |
| OLD | NEW |