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 <Windows.h> | 5 #include <Windows.h> |
6 #include <objbase.h> | 6 #include <objbase.h> |
7 | 7 |
8 #include "chrome/browser/download/download_file.h" | 8 #include "chrome/browser/download/download_file.h" |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 if (downloads_.empty()) | 572 if (downloads_.empty()) |
573 ui_loop_->PostTask(FROM_HERE, NewRunnableMethod( | 573 ui_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
574 this, &DownloadFileManager::StopUpdateTimer)); | 574 this, &DownloadFileManager::StopUpdateTimer)); |
575 } | 575 } |
576 | 576 |
577 void DownloadFileManager::CreateDirectory(const std::wstring& directory) { | 577 void DownloadFileManager::CreateDirectory(const std::wstring& directory) { |
578 if (!file_util::PathExists(directory)) | 578 if (!file_util::PathExists(directory)) |
579 file_util::CreateDirectory(directory); | 579 file_util::CreateDirectory(directory); |
580 } | 580 } |
| 581 |
| 582 void DownloadFileManager::DeleteFile(const std::wstring& path) { |
| 583 // Make sure we only delete files. |
| 584 if (file_util::PathExists(path) && !file_util::DirectoryExists(path)) |
| 585 file_util::Delete(path, false); |
| 586 } |
OLD | NEW |