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