| 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| 11 class DownloadFileManager; |
| 11 class DownloadItemImpl; | 12 class DownloadItemImpl; |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 class BrowserContext; | 15 class BrowserContext; |
| 15 } | 16 } |
| 16 | 17 |
| 17 // Delegate for operations that a DownloadItemImpl can't do for itself. | 18 // Delegate for operations that a DownloadItemImpl can't do for itself. |
| 18 // The base implementation of this class does nothing (returning false | 19 // The base implementation of this class does nothing (returning false |
| 19 // on predicates) so interfaces not of interest to a derived class may | 20 // on predicates) so interfaces not of interest to a derived class may |
| 20 // be left unimplemented. | 21 // be left unimplemented. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 40 // to OnDownloadedFileRemoved(). | 41 // to OnDownloadedFileRemoved(). |
| 41 virtual void CheckForFileRemoval(DownloadItemImpl* download_item); | 42 virtual void CheckForFileRemoval(DownloadItemImpl* download_item); |
| 42 | 43 |
| 43 // If all pre-requisites have been met, complete download processing. | 44 // If all pre-requisites have been met, complete download processing. |
| 44 // TODO(rdsmith): Move into DownloadItem. | 45 // TODO(rdsmith): Move into DownloadItem. |
| 45 virtual void MaybeCompleteDownload(DownloadItemImpl* download); | 46 virtual void MaybeCompleteDownload(DownloadItemImpl* download); |
| 46 | 47 |
| 47 // For contextual issues like language and prefs. | 48 // For contextual issues like language and prefs. |
| 48 virtual content::BrowserContext* GetBrowserContext() const; | 49 virtual content::BrowserContext* GetBrowserContext() const; |
| 49 | 50 |
| 51 // Get the DownloadFileManager to use for this download. |
| 52 virtual DownloadFileManager* GetDownloadFileManager(); |
| 53 |
| 50 // Handle any delegate portions of a state change operation on the | 54 // Handle any delegate portions of a state change operation on the |
| 51 // DownloadItem. | 55 // DownloadItem. |
| 52 virtual void DownloadStopped(DownloadItemImpl* download); | 56 virtual void DownloadStopped(DownloadItemImpl* download); |
| 53 virtual void DownloadCompleted(DownloadItemImpl* download); | 57 virtual void DownloadCompleted(DownloadItemImpl* download); |
| 54 virtual void DownloadOpened(DownloadItemImpl* download); | 58 virtual void DownloadOpened(DownloadItemImpl* download); |
| 55 virtual void DownloadRemoved(DownloadItemImpl* download); | 59 virtual void DownloadRemoved(DownloadItemImpl* download); |
| 56 virtual void DownloadRenamedToIntermediateName( | 60 virtual void DownloadRenamedToIntermediateName( |
| 57 DownloadItemImpl* download); | 61 DownloadItemImpl* download); |
| 58 virtual void DownloadRenamedToFinalName(DownloadItemImpl* download); | 62 virtual void DownloadRenamedToFinalName(DownloadItemImpl* download); |
| 59 | 63 |
| 60 // Assert consistent state for delgate object at various transitions. | 64 // Assert consistent state for delgate object at various transitions. |
| 61 virtual void AssertStateConsistent(DownloadItemImpl* download) const; | 65 virtual void AssertStateConsistent(DownloadItemImpl* download) const; |
| 62 | 66 |
| 63 private: | 67 private: |
| 64 // For "Outlives attached DownloadItemImpl" invariant assertion. | 68 // For "Outlives attached DownloadItemImpl" invariant assertion. |
| 65 int count_; | 69 int count_; |
| 66 | 70 |
| 67 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate); |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ | 74 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ |
| OLD | NEW |