| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 virtual void UpdateItemInPersistentStore(DownloadItem* item) = 0; | 70 virtual void UpdateItemInPersistentStore(DownloadItem* item) = 0; |
| 71 | 71 |
| 72 // Notifies the delegate that path for the download item has changed, so that | 72 // Notifies the delegate that path for the download item has changed, so that |
| 73 // it can update its persistent store. | 73 // it can update its persistent store. |
| 74 virtual void UpdatePathForItemInPersistentStore( | 74 virtual void UpdatePathForItemInPersistentStore( |
| 75 DownloadItem* item, | 75 DownloadItem* item, |
| 76 const FilePath& new_path) = 0; | 76 const FilePath& new_path) = 0; |
| 77 | 77 |
| 78 // Notifies the delegate that it should remove the download item from its | 78 // Notifies the delegate that it should remove the download item from its |
| 79 // persistent store. | 79 // persistent store. |
| 80 virtual void RemoveItemFromPersistentStore(DownloadItem* item) = 0; | 80 virtual void RemoveItemFromPersistentStore(int64 db_handle) = 0; |
| 81 | 81 |
| 82 // Notifies the delegate to remove downloads from the given time range. | 82 // Notifies the delegate to remove downloads from the given time range. |
| 83 virtual void RemoveItemsFromPersistentStoreBetween( | 83 virtual void RemoveItemsFromPersistentStoreBetween( |
| 84 const base::Time remove_begin, | 84 const base::Time remove_begin, |
| 85 const base::Time remove_end) = 0; | 85 const base::Time remove_end) = 0; |
| 86 | 86 |
| 87 // Retrieve the directories to save html pages and downloads to. | 87 // Retrieve the directories to save html pages and downloads to. |
| 88 virtual void GetSaveDir(TabContents* tab_contents, | 88 virtual void GetSaveDir(TabContents* tab_contents, |
| 89 FilePath* website_save_dir, | 89 FilePath* website_save_dir, |
| 90 FilePath* download_save_dir) = 0; | 90 FilePath* download_save_dir) = 0; |
| 91 | 91 |
| 92 // Asks the user for the path to save a page. The delegate calls | 92 // Asks the user for the path to save a page. The delegate calls |
| 93 // SavePackage::OnPathPicked to give the answer. | 93 // SavePackage::OnPathPicked to give the answer. |
| 94 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package, | 94 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package, |
| 95 const FilePath& suggested_path, | 95 const FilePath& suggested_path, |
| 96 bool can_save_as_complete) = 0; | 96 bool can_save_as_complete) = 0; |
| 97 | 97 |
| 98 // Informs the delegate that the progress of downloads has changed. | 98 // Informs the delegate that the progress of downloads has changed. |
| 99 virtual void DownloadProgressUpdated() = 0; | 99 virtual void DownloadProgressUpdated() = 0; |
| 100 | 100 |
| 101 protected: | 101 protected: |
| 102 DownloadManagerDelegate() {} | 102 DownloadManagerDelegate() {} |
| 103 virtual ~DownloadManagerDelegate() {} | 103 virtual ~DownloadManagerDelegate() {} |
| 104 | 104 |
| 105 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); | 105 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ | 108 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |