| 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 "base/logging.h" |
| 5 #include "content/browser/download/download_item_impl_delegate.h" | 6 #include "content/browser/download/download_item_impl_delegate.h" |
| 6 | 7 |
| 7 #include "base/logging.h" | |
| 8 #include "content/browser/download/download_file_factory.h" | |
| 9 | |
| 10 class DownloadItemImpl; | 8 class DownloadItemImpl; |
| 11 | 9 |
| 12 // Infrastructure in DownloadItemImplDelegate to assert invariant that | 10 // Infrastructure in DownloadItemImplDelegate to assert invariant that |
| 13 // delegate always outlives all attached DownloadItemImpls. | 11 // delegate always outlives all attached DownloadItemImpls. |
| 14 DownloadItemImplDelegate::DownloadItemImplDelegate() | 12 DownloadItemImplDelegate::DownloadItemImplDelegate() |
| 15 : count_(0) {} | 13 : count_(0) {} |
| 16 | 14 |
| 17 DownloadItemImplDelegate::~DownloadItemImplDelegate() { | 15 DownloadItemImplDelegate::~DownloadItemImplDelegate() { |
| 18 DCHECK_EQ(0, count_); | 16 DCHECK_EQ(0, count_); |
| 19 } | 17 } |
| 20 | 18 |
| 21 void DownloadItemImplDelegate::Attach() { | 19 void DownloadItemImplDelegate::Attach() { |
| 22 ++count_; | 20 ++count_; |
| 23 } | 21 } |
| 24 | 22 |
| 25 void DownloadItemImplDelegate::Detach() { | 23 void DownloadItemImplDelegate::Detach() { |
| 26 DCHECK_LT(0, count_); | 24 DCHECK_LT(0, count_); |
| 27 --count_; | 25 --count_; |
| 28 } | 26 } |
| 29 | 27 |
| 30 void DownloadItemImplDelegate::DelegateStart( | |
| 31 DownloadItemImpl* download_item) {} | |
| 32 | |
| 33 bool DownloadItemImplDelegate::ShouldOpenDownload(DownloadItemImpl* download) { | |
| 34 return false; | |
| 35 } | |
| 36 | |
| 37 bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension( | 28 bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension( |
| 38 const FilePath& path) { | 29 const FilePath& path) { |
| 39 return false; | 30 return false; |
| 40 } | 31 } |
| 41 | 32 |
| 33 bool DownloadItemImplDelegate::ShouldOpenDownload(DownloadItemImpl* download) { |
| 34 return false; |
| 35 } |
| 36 |
| 42 void DownloadItemImplDelegate::CheckForFileRemoval( | 37 void DownloadItemImplDelegate::CheckForFileRemoval( |
| 43 DownloadItemImpl* download_item) {} | 38 DownloadItemImpl* download_item) {} |
| 44 | 39 |
| 45 void DownloadItemImplDelegate::MaybeCompleteDownload( | 40 void DownloadItemImplDelegate::MaybeCompleteDownload( |
| 46 DownloadItemImpl* download) {} | 41 DownloadItemImpl* download) {} |
| 47 | 42 |
| 48 content::BrowserContext* DownloadItemImplDelegate::GetBrowserContext() const { | 43 content::BrowserContext* DownloadItemImplDelegate::GetBrowserContext() const { |
| 49 return NULL; | 44 return NULL; |
| 50 } | 45 } |
| 51 | 46 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {} | 57 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {} |
| 63 | 58 |
| 64 void DownloadItemImplDelegate::DownloadRenamedToIntermediateName( | 59 void DownloadItemImplDelegate::DownloadRenamedToIntermediateName( |
| 65 DownloadItemImpl* download) {} | 60 DownloadItemImpl* download) {} |
| 66 | 61 |
| 67 void DownloadItemImplDelegate::DownloadRenamedToFinalName( | 62 void DownloadItemImplDelegate::DownloadRenamedToFinalName( |
| 68 DownloadItemImpl* download) {} | 63 DownloadItemImpl* download) {} |
| 69 | 64 |
| 70 void DownloadItemImplDelegate::AssertStateConsistent( | 65 void DownloadItemImplDelegate::AssertStateConsistent( |
| 71 DownloadItemImpl* download) const {} | 66 DownloadItemImpl* download) const {} |
| OLD | NEW |