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_TEST_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 bool select_file_dialog_seen() const { return select_file_dialog_seen_; } | 55 bool select_file_dialog_seen() const { return select_file_dialog_seen_; } |
56 | 56 |
57 // Wait for the requested number of downloads to enter a terminal state. | 57 // Wait for the requested number of downloads to enter a terminal state. |
58 void WaitForFinished(); | 58 void WaitForFinished(); |
59 | 59 |
60 // Return true if everything's happened that we're configured for. | 60 // Return true if everything's happened that we're configured for. |
61 bool IsFinished() const; | 61 bool IsFinished() const; |
62 | 62 |
63 // content::DownloadItem::Observer | 63 // content::DownloadItem::Observer |
64 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 64 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
65 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} | 65 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
66 | 66 |
67 // content::DownloadManager::Observer | 67 // content::DownloadManager::Observer |
68 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 68 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
69 | 69 |
70 virtual void SelectFileDialogDisplayed( | 70 virtual void SelectFileDialogDisplayed( |
71 content::DownloadManager* manager, int32 id) OVERRIDE; | 71 content::DownloadManager* manager, int32 id) OVERRIDE; |
72 | 72 |
73 size_t NumDangerousDownloadsSeen() const; | 73 size_t NumDangerousDownloadsSeen() const; |
74 | 74 |
75 size_t NumDownloadsSeenInState( | 75 size_t NumDownloadsSeenInState( |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 explicit DownloadTestFlushObserver( | 209 explicit DownloadTestFlushObserver( |
210 content::DownloadManager* download_manager); | 210 content::DownloadManager* download_manager); |
211 | 211 |
212 void WaitForFlush(); | 212 void WaitForFlush(); |
213 | 213 |
214 // DownloadsManager observer methods. | 214 // DownloadsManager observer methods. |
215 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 215 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
216 | 216 |
217 // DownloadItem observer methods. | 217 // DownloadItem observer methods. |
218 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 218 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
219 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} | 219 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
220 | 220 |
221 protected: | 221 protected: |
222 friend class base::RefCountedThreadSafe<DownloadTestFlushObserver>; | 222 friend class base::RefCountedThreadSafe<DownloadTestFlushObserver>; |
223 | 223 |
224 virtual ~DownloadTestFlushObserver(); | 224 virtual ~DownloadTestFlushObserver(); |
225 | 225 |
226 private: | 226 private: |
227 typedef std::set<content::DownloadItem*> DownloadSet; | 227 typedef std::set<content::DownloadItem*> DownloadSet; |
228 | 228 |
229 // If we're waiting for that flush point, check the number | 229 // If we're waiting for that flush point, check the number |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Count of callbacks. | 274 // Count of callbacks. |
275 size_t called_back_count_; | 275 size_t called_back_count_; |
276 | 276 |
277 // We are in the message loop. | 277 // We are in the message loop. |
278 bool waiting_; | 278 bool waiting_; |
279 | 279 |
280 DISALLOW_COPY_AND_ASSIGN(DownloadTestItemCreationObserver); | 280 DISALLOW_COPY_AND_ASSIGN(DownloadTestItemCreationObserver); |
281 }; | 281 }; |
282 | 282 |
283 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ | 283 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ |
OLD | NEW |