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_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
| 10 #include "base/macros.h" |
| 11 #include "content/public/browser/download_item.h" |
10 #include "content/public/browser/download_manager.h" | 12 #include "content/public/browser/download_manager.h" |
11 #include "content/public/browser/download_item.h" | |
12 | 13 |
13 // AllDownloadItemNotifier observes ALL the DownloadItems on a given | 14 // AllDownloadItemNotifier observes ALL the DownloadItems on a given |
14 // DownloadManager. | 15 // DownloadManager. |
15 // Clients should use GetManager() instead of storing their own pointer to the | 16 // Clients should use GetManager() instead of storing their own pointer to the |
16 // manager so that they can be sensitive to managers that have gone down. | 17 // manager so that they can be sensitive to managers that have gone down. |
17 | 18 |
18 // Example Usage: | 19 // Example Usage: |
19 // class DownloadSystemConsumer : public AllDownloadItemNotifier::Observer { | 20 // class DownloadSystemConsumer : public AllDownloadItemNotifier::Observer { |
20 // public: | 21 // public: |
21 // DownloadSystemConsumer(content::DownloadManager* original_manager, | 22 // DownloadSystemConsumer(content::DownloadManager* original_manager, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void OnDownloadDestroyed(content::DownloadItem* item) override; | 78 void OnDownloadDestroyed(content::DownloadItem* item) override; |
78 | 79 |
79 content::DownloadManager* manager_; | 80 content::DownloadManager* manager_; |
80 AllDownloadItemNotifier::Observer* observer_; | 81 AllDownloadItemNotifier::Observer* observer_; |
81 std::set<content::DownloadItem*> observing_; | 82 std::set<content::DownloadItem*> observing_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(AllDownloadItemNotifier); | 84 DISALLOW_COPY_AND_ASSIGN(AllDownloadItemNotifier); |
84 }; | 85 }; |
85 | 86 |
86 #endif // CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ | 87 #endif // CHROME_BROWSER_DOWNLOAD_ALL_DOWNLOAD_ITEM_NOTIFIER_H_ |
OLD | NEW |