Home | History | Annotate | Download | only in download

Lines Matching refs:info

256 void DownloadManager::StartDownload(DownloadCreateInfo* info) {
262 info->download_id, info->url_chain, info->referrer_url);
264 info, NewCallback(this, &DownloadManager::CheckDownloadUrlDone));
267 void DownloadManager::CheckDownloadUrlDone(DownloadCreateInfo* info,
270 DCHECK(info);
272 info->is_dangerous_url = is_dangerous_url;
276 if (!info->prompt_user_for_save_location) {
277 if (UserScript::IsURLUserScript(info->url(), info->mime_type) ||
278 info->mime_type == Extension::kMimeType) {
279 info->is_extension_install = true;
283 if (info->save_info.file_path.empty()) {
285 download_util::GenerateFileNameFromInfo(info, &generated_name);
297 if (!info->is_extension_install &&
299 info->prompt_user_for_save_location = true;
302 info->prompt_user_for_save_location = false;
308 if (info->prompt_user_for_save_location && !last_download_path_.empty()) {
309 info->suggested_path = last_download_path_;
311 info->suggested_path = download_prefs_->download_path();
313 info->suggested_path = info->suggested_path.Append(generated_name);
315 info->suggested_path = info->save_info.file_path;
318 if (!info->prompt_user_for_save_location &&
319 info->save_info.file_path.empty()) {
320 info->is_dangerous_file = download_util::IsDangerous(
321 info, profile(), ShouldOpenFileBasedOnExtension(info->suggested_path));
333 info,
337 void DownloadManager::CheckIfSuggestedPathExists(DownloadCreateInfo* info,
340 DCHECK(info);
349 FilePath dir = info->suggested_path.DirName();
350 FilePath filename = info->suggested_path.BaseName();
353 info->prompt_user_for_save_location = true;
354 PathService::Get(chrome::DIR_USER_DOCUMENTS, &info->suggested_path);
355 info->suggested_path = info->suggested_path.Append(filename);
359 if (info->IsDangerous()) {
360 info->original_name = FilePath(info->suggested_path).BaseName();
383 info->suggested_path = path;
387 if (info->save_info.file_path.empty()) {
388 info->path_uniquifier = download_util::GetUniquePathNumberWithCrDownload(
389 info->suggested_path);
392 if (info->path_uniquifier > 0) {
393 download_util::AppendNumberToPath(&(info->suggested_path),
394 info->path_uniquifier);
397 info->path_uniquifier = 0;
398 } else if (info->path_uniquifier == -1) {
401 << info->suggested_path.value() << "\"";
402 info->prompt_user_for_save_location = true;
409 if (!info->prompt_user_for_save_location &&
410 info->save_info.file_path.empty()) {
411 if (info->IsDangerous())
412 file_util::WriteFile(info->suggested_path, "", 0);
415 info->suggested_path), "", 0);
422 info));
425 void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
426 VLOG(20) << __FUNCTION__ << "()" << " info = " << info->DebugString();
428 DCHECK(info);
430 if (info->prompt_user_for_save_location) {
435 TabContents* contents = tab_util::GetTabContentsByID(info->child_id,
436 info->render_view_id);
439 file_type_info.extensions[0].push_back(info->suggested_path.Extension());
447 info->suggested_path,
449 contents, owning_window, info);
451 SelectFileDialogDisplayed(info->download_id));
454 info->path = info->suggested_path;
455 AttachDownloadItem(info);
459 void DownloadManager::CreateDownloadItem(DownloadCreateInfo* info) {
462 DownloadItem* download = new DownloadItem(this, *info,
464 DCHECK(!ContainsKey(in_progress_, info->download_id));
465 DCHECK(!ContainsKey(active_downloads_, info->download_id));
467 active_downloads_[info->download_id] = download;
470 void DownloadManager::AttachDownloadItem(DownloadCreateInfo* info) {
471 VLOG(20) << __FUNCTION__ << "()" << " info = " << info->DebugString();
475 // Life of |info| ends here. No more references to it after this method.
476 scoped_ptr<DownloadCreateInfo> infop(info);
480 DCHECK(!ContainsKey(in_progress_, info->download_id));
481 DCHECK(ContainsKey(active_downloads_, info->download_id));
482 DownloadItem* download = active_downloads_[info->download_id];
486 download->SetFileCheckResults(info->path,
487 info->is_dangerous_file,
488 info->is_dangerous_url,
489 info->path_uniquifier,
490 info->prompt_user_for_save_location,
491 info->is_extension_install,
492 info->original_name);
493 in_progress_[info->download_id] = download;
498 if (info->IsDangerous()) {
503 download_path = info->path;
509 download_path = download_util::GetCrDownloadPath(info->path);
520 download_history_->AddEntry(*info, download,
978 DownloadCreateInfo* info = reinterpret_cast<DownloadCreateInfo*>(params);
979 if (info->prompt_user_for_save_location)
982 info->path = path;
983 AttachDownloadItem(info);
989 DownloadCreateInfo* info = reinterpret_cast<DownloadCreateInfo*>(params);
990 DownloadCancelledInternal(info->download_id,
991 info->child_id,
992 info->request_id);
1021 // Once the new DownloadItem's creation info has been committed to the history
1025 DownloadCreateInfo info,
1028 DownloadMap::iterator it = in_progress_.find(info.download_id);
1033 << " download_id = " << info.download_id
1052 ShowDownloadInBrowser(info, download);
1070 active_downloads_.erase(info.download_id);
1076 void DownloadManager::ShowDownloadInBrowser(const DownloadCreateInfo& info,
1081 TabContents* contents = tab_util::GetTabContentsByID(info.child_id,
1082 info.render_view_id);