Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: chrome/browser/download/download_test_observer.h

Issue 10704026: Reland DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 bool select_file_dialog_seen() const { return select_file_dialog_seen_; } 54 bool select_file_dialog_seen() const { return select_file_dialog_seen_; }
55 55
56 // Wait for the requested number of downloads to enter a terminal state. 56 // Wait for the requested number of downloads to enter a terminal state.
57 void WaitForFinished(); 57 void WaitForFinished();
58 58
59 // Return true if everything's happened that we're configured for. 59 // Return true if everything's happened that we're configured for.
60 bool IsFinished() const; 60 bool IsFinished() const;
61 61
62 // content::DownloadItem::Observer 62 // content::DownloadItem::Observer
63 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; 63 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
64 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} 64 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE;
65 65
66 // content::DownloadManager::Observer 66 // content::DownloadManager::Observer
67 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; 67 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE;
68 68
69 virtual void SelectFileDialogDisplayed( 69 virtual void SelectFileDialogDisplayed(
70 content::DownloadManager* manager, int32 id) OVERRIDE; 70 content::DownloadManager* manager, int32 id) OVERRIDE;
71 71
72 size_t NumDangerousDownloadsSeen() const; 72 size_t NumDangerousDownloadsSeen() const;
73 73
74 size_t NumDownloadsSeenInState( 74 size_t NumDownloadsSeenInState(
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 explicit DownloadTestFlushObserver( 208 explicit DownloadTestFlushObserver(
209 content::DownloadManager* download_manager); 209 content::DownloadManager* download_manager);
210 210
211 void WaitForFlush(); 211 void WaitForFlush();
212 212
213 // DownloadsManager observer methods. 213 // DownloadsManager observer methods.
214 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; 214 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE;
215 215
216 // DownloadItem observer methods. 216 // DownloadItem observer methods.
217 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; 217 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
218 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} 218 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE;
219 219
220 protected: 220 protected:
221 friend class base::RefCountedThreadSafe<DownloadTestFlushObserver>; 221 friend class base::RefCountedThreadSafe<DownloadTestFlushObserver>;
222 222
223 virtual ~DownloadTestFlushObserver(); 223 virtual ~DownloadTestFlushObserver();
224 224
225 private: 225 private:
226 typedef std::set<content::DownloadItem*> DownloadSet; 226 typedef std::set<content::DownloadItem*> DownloadSet;
227 227
228 // If we're waiting for that flush point, check the number 228 // If we're waiting for that flush point, check the number
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // Count of callbacks. 273 // Count of callbacks.
274 size_t called_back_count_; 274 size_t called_back_count_;
275 275
276 // We are in the message loop. 276 // We are in the message loop.
277 bool waiting_; 277 bool waiting_;
278 278
279 DISALLOW_COPY_AND_ASSIGN(DownloadTestItemCreationObserver); 279 DISALLOW_COPY_AND_ASSIGN(DownloadTestItemCreationObserver);
280 }; 280 };
281 281
282 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ 282 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698