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 CONTENT_TEST_DOWNLOAD_TEST_OBSERVER_H_ | 5 #ifndef CONTENT_TEST_DOWNLOAD_TEST_OBSERVER_H_ |
6 #define CONTENT_TEST_DOWNLOAD_TEST_OBSERVER_H_ | 6 #define CONTENT_TEST_DOWNLOAD_TEST_OBSERVER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Wait for the requested number of downloads to enter a terminal state. | 50 // Wait for the requested number of downloads to enter a terminal state. |
51 void WaitForFinished(); | 51 void WaitForFinished(); |
52 | 52 |
53 // Return true if everything's happened that we're configured for. | 53 // Return true if everything's happened that we're configured for. |
54 bool IsFinished() const; | 54 bool IsFinished() const; |
55 | 55 |
56 // DownloadItem::Observer | 56 // DownloadItem::Observer |
57 virtual void OnDownloadUpdated(DownloadItem* download) OVERRIDE; | 57 virtual void OnDownloadUpdated(DownloadItem* download) OVERRIDE; |
58 virtual void OnDownloadDestroyed(DownloadItem* download) OVERRIDE; | 58 virtual void OnDownloadDestroyed(DownloadItem* download) OVERRIDE; |
59 | 59 |
60 // DownloadManager::Observer | 60 // content::DownloadManager::Observer |
61 virtual void ModelChanged(DownloadManager* manager) OVERRIDE; | 61 virtual void OnDownloadCreated(content::DownloadManager* manager, |
| 62 content::DownloadItem* item) OVERRIDE; |
| 63 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
62 | 64 |
63 size_t NumDangerousDownloadsSeen() const; | 65 size_t NumDangerousDownloadsSeen() const; |
64 | 66 |
65 size_t NumDownloadsSeenInState(DownloadItem::DownloadState state) const; | 67 size_t NumDownloadsSeenInState(DownloadItem::DownloadState state) const; |
66 | 68 |
67 protected: | 69 protected: |
68 // Only to be called by derived classes' constructors. | 70 // Only to be called by derived classes' constructors. |
69 virtual void Init(); | 71 virtual void Init(); |
70 | 72 |
71 // Called to see if a download item is in a final state. | 73 // Called to see if a download item is in a final state. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 256 |
255 // We are in the message loop. | 257 // We are in the message loop. |
256 bool waiting_; | 258 bool waiting_; |
257 | 259 |
258 DISALLOW_COPY_AND_ASSIGN(DownloadTestItemCreationObserver); | 260 DISALLOW_COPY_AND_ASSIGN(DownloadTestItemCreationObserver); |
259 }; | 261 }; |
260 | 262 |
261 } // namespace content` | 263 } // namespace content` |
262 | 264 |
263 #endif // CONTENT_TEST_DOWNLOAD_TEST_OBSERVER_H_ | 265 #endif // CONTENT_TEST_DOWNLOAD_TEST_OBSERVER_H_ |
OLD | NEW |