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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // May add |item| to |history_|. | 104 // May add |item| to |history_|. |
105 void MaybeAddToHistory(content::DownloadItem* item); | 105 void MaybeAddToHistory(content::DownloadItem* item); |
106 | 106 |
107 // Callback from |history_| when an item was successfully inserted into the | 107 // Callback from |history_| when an item was successfully inserted into the |
108 // database. | 108 // database. |
109 void ItemAdded(uint32 id, bool success); | 109 void ItemAdded(uint32 id, bool success); |
110 | 110 |
111 // AllDownloadItemNotifier::Observer | 111 // AllDownloadItemNotifier::Observer |
112 virtual void OnDownloadCreated( | 112 virtual void OnDownloadCreated( |
113 content::DownloadManager* manager, content::DownloadItem* item) OVERRIDE; | 113 content::DownloadManager* manager, content::DownloadItem* item) override; |
114 virtual void OnDownloadUpdated( | 114 virtual void OnDownloadUpdated( |
115 content::DownloadManager* manager, content::DownloadItem* item) OVERRIDE; | 115 content::DownloadManager* manager, content::DownloadItem* item) override; |
116 virtual void OnDownloadOpened( | 116 virtual void OnDownloadOpened( |
117 content::DownloadManager* manager, content::DownloadItem* item) OVERRIDE; | 117 content::DownloadManager* manager, content::DownloadItem* item) override; |
118 virtual void OnDownloadRemoved( | 118 virtual void OnDownloadRemoved( |
119 content::DownloadManager* manager, content::DownloadItem* item) OVERRIDE; | 119 content::DownloadManager* manager, content::DownloadItem* item) override; |
120 | 120 |
121 // Schedule a record to be removed from |history_| the next time | 121 // Schedule a record to be removed from |history_| the next time |
122 // RemoveDownloadsBatch() runs. Schedule RemoveDownloadsBatch() to be run soon | 122 // RemoveDownloadsBatch() runs. Schedule RemoveDownloadsBatch() to be run soon |
123 // if it isn't already scheduled. | 123 // if it isn't already scheduled. |
124 void ScheduleRemoveDownload(uint32 download_id); | 124 void ScheduleRemoveDownload(uint32 download_id); |
125 | 125 |
126 // Removes all |removing_ids_| from |history_|. | 126 // Removes all |removing_ids_| from |history_|. |
127 void RemoveDownloadsBatch(); | 127 void RemoveDownloadsBatch(); |
128 | 128 |
129 AllDownloadItemNotifier notifier_; | 129 AllDownloadItemNotifier notifier_; |
(...skipping 19 matching lines...) Expand all Loading... |
149 int64 history_size_; | 149 int64 history_size_; |
150 | 150 |
151 ObserverList<Observer> observers_; | 151 ObserverList<Observer> observers_; |
152 | 152 |
153 base::WeakPtrFactory<DownloadHistory> weak_ptr_factory_; | 153 base::WeakPtrFactory<DownloadHistory> weak_ptr_factory_; |
154 | 154 |
155 DISALLOW_COPY_AND_ASSIGN(DownloadHistory); | 155 DISALLOW_COPY_AND_ASSIGN(DownloadHistory); |
156 }; | 156 }; |
157 | 157 |
158 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ | 158 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ |
OLD | NEW |