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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 const std::string& hash) = 0; | 67 const std::string& hash) = 0; |
68 | 68 |
69 // Notifies the delegate that a new download item is created. The | 69 // Notifies the delegate that a new download item is created. The |
70 // DownloadManager waits for the delegate to add information about this | 70 // DownloadManager waits for the delegate to add information about this |
71 // download to its persistent store. When the delegate is done, it calls | 71 // download to its persistent store. When the delegate is done, it calls |
72 // DownloadManager::OnDownloadItemAddedToPersistentStore. | 72 // DownloadManager::OnDownloadItemAddedToPersistentStore. |
73 virtual void AddItemToPersistentStore(DownloadItem* item) = 0; | 73 virtual void AddItemToPersistentStore(DownloadItem* item) = 0; |
74 | 74 |
75 // Notifies the delegate that information about the given download has change, | 75 // Notifies the delegate that information about the given download has change, |
76 // so that it can update its persistent store. | 76 // so that it can update its persistent store. |
| 77 // Does not update |url|, |start_time|, |total_bytes|; uses |db_handle| only |
| 78 // to select the row in the database table to update. |
77 virtual void UpdateItemInPersistentStore(DownloadItem* item) = 0; | 79 virtual void UpdateItemInPersistentStore(DownloadItem* item) = 0; |
78 | 80 |
79 // Notifies the delegate that path for the download item has changed, so that | 81 // Notifies the delegate that path for the download item has changed, so that |
80 // it can update its persistent store. | 82 // it can update its persistent store. |
81 virtual void UpdatePathForItemInPersistentStore( | 83 virtual void UpdatePathForItemInPersistentStore( |
82 DownloadItem* item, | 84 DownloadItem* item, |
83 const FilePath& new_path) = 0; | 85 const FilePath& new_path) = 0; |
84 | 86 |
85 // Notifies the delegate that it should remove the download item from its | 87 // Notifies the delegate that it should remove the download item from its |
86 // persistent store. | 88 // persistent store. |
(...skipping 18 matching lines...) Expand all Loading... |
105 // Informs the delegate that the progress of downloads has changed. | 107 // Informs the delegate that the progress of downloads has changed. |
106 virtual void DownloadProgressUpdated() = 0; | 108 virtual void DownloadProgressUpdated() = 0; |
107 | 109 |
108 protected: | 110 protected: |
109 DownloadManagerDelegate() {} | 111 DownloadManagerDelegate() {} |
110 | 112 |
111 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); | 113 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); |
112 }; | 114 }; |
113 | 115 |
114 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ | 116 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |