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_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 class ExtensionDownloadsEventRouter : public content::DownloadManager::Observer, | 215 class ExtensionDownloadsEventRouter : public content::DownloadManager::Observer, |
216 public content::DownloadItem::Observer { | 216 public content::DownloadItem::Observer { |
217 public: | 217 public: |
218 explicit ExtensionDownloadsEventRouter( | 218 explicit ExtensionDownloadsEventRouter( |
219 Profile* profile, content::DownloadManager* manager); | 219 Profile* profile, content::DownloadManager* manager); |
220 virtual ~ExtensionDownloadsEventRouter(); | 220 virtual ~ExtensionDownloadsEventRouter(); |
221 | 221 |
222 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 222 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
223 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; | 223 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; |
224 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 224 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
225 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; | 225 virtual void OnDownloadRemoved(content::DownloadItem* download) OVERRIDE; |
| 226 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
226 | 227 |
227 // Used for testing. | 228 // Used for testing. |
228 struct DownloadsNotificationSource { | 229 struct DownloadsNotificationSource { |
229 std::string event_name; | 230 std::string event_name; |
230 Profile* profile; | 231 Profile* profile; |
231 }; | 232 }; |
232 | 233 |
233 private: | 234 private: |
234 struct OnChangedStat { | 235 struct OnChangedStat { |
235 OnChangedStat(); | 236 OnChangedStat(); |
(...skipping 11 matching lines...) Expand all Loading... |
247 Profile* profile_; | 248 Profile* profile_; |
248 content::DownloadManager* manager_; | 249 content::DownloadManager* manager_; |
249 ItemMap downloads_; | 250 ItemMap downloads_; |
250 ItemJsonMap item_jsons_; | 251 ItemJsonMap item_jsons_; |
251 OnChangedStatMap on_changed_stats_; | 252 OnChangedStatMap on_changed_stats_; |
252 | 253 |
253 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); | 254 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
254 }; | 255 }; |
255 | 256 |
256 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 257 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
OLD | NEW |