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

Unified Diff: chrome/browser/ui/webui/active_downloads_ui.cc

Issue 7241007: Support for testing by providing access to DownloadsList. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/active_downloads_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/active_downloads_ui.cc
===================================================================
--- chrome/browser/ui/webui/active_downloads_ui.cc (revision 89670)
+++ chrome/browser/ui/webui/active_downloads_ui.cc (working copy)
@@ -114,6 +114,10 @@
void OpenNewFullWindow(const ListValue* args);
void PlayMediaFile(const ListValue* args);
+ // For testing.
+ typedef std::vector<DownloadItem*> DownloadList;
+ const DownloadList& downloads() const { return downloads_; }
+
private:
// Downloads helpers.
DownloadItem* GetDownloadById(const ListValue* args);
@@ -126,7 +130,6 @@
TabContents* tab_contents_;
DownloadManager* download_manager_;
- typedef std::vector<DownloadItem*> DownloadList;
DownloadList active_downloads_;
DownloadList downloads_;
@@ -433,3 +436,9 @@
return NULL;
}
+const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const {
+ DCHECK_EQ(handlers_.size(), size_t(2));
+ ActiveDownloadsHandler* handler =
+ static_cast<ActiveDownloadsHandler*>(handlers_[1]);
achuithb 2011/06/22 22:50:50 I don't like this either :/
xiyuan 2011/06/22 23:01:03 Me neither. What is the other handler here? How co
achuithb 2011/06/23 02:56:38 The other handler is the GenericHandler that all W
+ return handler->downloads();
+}
« no previous file with comments | « chrome/browser/ui/webui/active_downloads_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698