OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <time.h> | 5 #include <time.h> |
6 | 6 |
7 #include "chrome/browser/download/download_manager.h" | 7 #include "chrome/browser/download/download_manager.h" |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 // We must ask the user for the place to put the download. | 601 // We must ask the user for the place to put the download. |
602 if (!select_file_dialog_.get()) | 602 if (!select_file_dialog_.get()) |
603 select_file_dialog_ = SelectFileDialog::Create(this); | 603 select_file_dialog_ = SelectFileDialog::Create(this); |
604 | 604 |
605 TabContents* contents = tab_util::GetTabContentsByID( | 605 TabContents* contents = tab_util::GetTabContentsByID( |
606 info->render_process_id, info->render_view_id); | 606 info->render_process_id, info->render_view_id); |
607 HWND owning_hwnd = | 607 HWND owning_hwnd = |
608 contents ? GetAncestor(contents->GetContainerHWND(), GA_ROOT) : NULL; | 608 contents ? GetAncestor(contents->GetContainerHWND(), GA_ROOT) : NULL; |
609 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE, | 609 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE, |
610 std::wstring(), info->suggested_path, | 610 std::wstring(), info->suggested_path, |
| 611 std::wstring(), std::wstring(), |
611 owning_hwnd, info); | 612 owning_hwnd, info); |
612 } else { | 613 } else { |
613 // No prompting for download, just continue with the suggested name. | 614 // No prompting for download, just continue with the suggested name. |
614 ContinueStartDownload(info, info->suggested_path); | 615 ContinueStartDownload(info, info->suggested_path); |
615 } | 616 } |
616 } | 617 } |
617 | 618 |
618 void DownloadManager::ContinueStartDownload(DownloadCreateInfo* info, | 619 void DownloadManager::ContinueStartDownload(DownloadCreateInfo* info, |
619 const std::wstring& target_path) { | 620 const std::wstring& target_path) { |
620 scoped_ptr<DownloadCreateInfo> infop(info); | 621 scoped_ptr<DownloadCreateInfo> infop(info); |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 std::vector<DownloadItem*> searched_downloads; | 1327 std::vector<DownloadItem*> searched_downloads; |
1327 for (std::vector<int64>::iterator it = results->begin(); | 1328 for (std::vector<int64>::iterator it = results->begin(); |
1328 it != results->end(); ++it) { | 1329 it != results->end(); ++it) { |
1329 DownloadMap::iterator dit = downloads_.find(*it); | 1330 DownloadMap::iterator dit = downloads_.find(*it); |
1330 if (dit != downloads_.end()) | 1331 if (dit != downloads_.end()) |
1331 searched_downloads.push_back(dit->second); | 1332 searched_downloads.push_back(dit->second); |
1332 } | 1333 } |
1333 | 1334 |
1334 requestor->SetDownloads(searched_downloads); | 1335 requestor->SetDownloads(searched_downloads); |
1335 } | 1336 } |
OLD | NEW |