| 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/public/browser/download_manager_delegate.h" | 5 #include "content/public/browser/download_manager_delegate.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" |
| 7 #include "content/public/browser/download_id.h" | 8 #include "content/public/browser/download_id.h" |
| 8 #include "content/public/browser/download_item.h" | 9 #include "content/public/browser/download_item.h" |
| 9 | 10 |
| 10 namespace content { | 11 namespace content { |
| 11 | 12 |
| 12 DownloadId DownloadManagerDelegate::GetNextId() { | 13 DownloadId DownloadManagerDelegate::GetNextId() { |
| 13 return DownloadId::Invalid(); | 14 return DownloadId::Invalid(); |
| 14 } | 15 } |
| 15 | 16 |
| 16 bool DownloadManagerDelegate::DetermineDownloadTarget( | 17 bool DownloadManagerDelegate::DetermineDownloadTarget( |
| 17 DownloadItem* item, | 18 DownloadItem* item, |
| 18 const DownloadTargetCallback& callback) { | 19 const DownloadTargetCallback& callback) { |
| 19 return false; | 20 return false; |
| 20 } | 21 } |
| 21 | 22 |
| 23 int64 DownloadManagerDelegate::GetIntermediateFileLength( |
| 24 const FilePath& path, bool temporary) { |
| 25 // Validate the start offset. |
| 26 int64 end = 0; |
| 27 if (file_util::GetFileSize(path, &end)) { |
| 28 return end; |
| 29 } |
| 30 return 0; |
| 31 } |
| 32 |
| 22 WebContents* DownloadManagerDelegate:: | 33 WebContents* DownloadManagerDelegate:: |
| 23 GetAlternativeWebContentsToNotifyForDownload() { | 34 GetAlternativeWebContentsToNotifyForDownload() { |
| 24 return NULL; | 35 return NULL; |
| 25 } | 36 } |
| 26 | 37 |
| 27 bool DownloadManagerDelegate::ShouldOpenFileBasedOnExtension( | 38 bool DownloadManagerDelegate::ShouldOpenFileBasedOnExtension( |
| 28 const FilePath& path) { | 39 const FilePath& path) { |
| 29 return false; | 40 return false; |
| 30 } | 41 } |
| 31 | 42 |
| 32 bool DownloadManagerDelegate::ShouldCompleteDownload( | 43 bool DownloadManagerDelegate::ShouldCompleteDownload( |
| 33 DownloadItem* item, | 44 DownloadItem* item, |
| 34 const base::Closure& complete_callback) { | 45 const base::Closure& complete_callback) { |
| 35 return true; | 46 return true; |
| 36 } | 47 } |
| 37 | 48 |
| 38 bool DownloadManagerDelegate::ShouldOpenDownload(DownloadItem* item) { | 49 bool DownloadManagerDelegate::ShouldOpenDownload(DownloadItem* item) { |
| 39 return true; | 50 return true; |
| 40 } | 51 } |
| 41 | 52 |
| 42 bool DownloadManagerDelegate::GenerateFileHash() { | 53 bool DownloadManagerDelegate::GenerateFileHash() { |
| 43 return false; | 54 return false; |
| 44 } | 55 } |
| 45 | 56 |
| 46 DownloadManagerDelegate::~DownloadManagerDelegate() {} | 57 DownloadManagerDelegate::~DownloadManagerDelegate() {} |
| 47 | 58 |
| 48 } // namespace content | 59 } // namespace content |
| OLD | NEW |