Index: chrome/browser/dom_ui/filebrowse_ui.cc |
diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc |
index ef5a86794c3d0b021d840bd46c2f8f8455a0bfb3..17375df5951fc9ab468f3a8dd11628639bd91d66 100644 |
--- a/chrome/browser/dom_ui/filebrowse_ui.cc |
+++ b/chrome/browser/dom_ui/filebrowse_ui.cc |
@@ -126,7 +126,7 @@ class FilebrowseHandler : public net::DirectoryLister::DirectoryListerDelegate, |
// DownloadItem::Observer interface |
virtual void OnDownloadUpdated(DownloadItem* download); |
- virtual void OnDownloadFileCompleted(DownloadItem* download) { } |
+ virtual void OnDownloadFileCompleted(DownloadItem* download); |
virtual void OnDownloadOpened(DownloadItem* download) { } |
// DownloadManager::Observer interface |
@@ -196,6 +196,9 @@ class FilebrowseHandler : public net::DirectoryLister::DirectoryListerDelegate, |
private: |
+ // Retrieves downloads from the DownloadManager and updates the page. |
+ void UpdateDownloadList(); |
+ |
void OpenNewWindow(const ListValue* args, bool popup); |
// Clear all download items and their observers. |
@@ -901,10 +904,17 @@ void FilebrowseHandler::HandleGetMetadata(const ListValue* args) { |
} |
void FilebrowseHandler::HandleGetDownloads(const ListValue* args) { |
- ModelChanged(); |
+ UpdateDownloadList(); |
} |
void FilebrowseHandler::ModelChanged() { |
+ if (!currentpath_.empty()) |
+ GetChildrenForPath(currentpath_, true); |
+ else |
+ UpdateDownloadList(); |
+} |
+ |
+void FilebrowseHandler::UpdateDownloadList() { |
ClearDownloadItems(); |
std::vector<DownloadItem*> downloads; |
@@ -1113,6 +1123,10 @@ void FilebrowseHandler::SendCurrentDownloads() { |
dom_ui_->CallJavascriptFunction(L"downloadsList", results_value); |
} |
+void FilebrowseHandler::OnDownloadFileCompleted(DownloadItem* download) { |
+ GetChildrenForPath(currentpath_, true); |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// |
// FileBrowseUI |