summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_manager.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 05:59:59 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 05:59:59 +0000
commite93d2823ba7df0b5f8d4d3869d6f0d7d94264012 (patch)
tree7e3783f67b8a68605dec8b3493252029c22aa3d5 /chrome/browser/download/download_manager.cc
parent7663e411f3f65fb232093cb3b078a5ef733562e6 (diff)
downloadchromium_src-e93d2823ba7df0b5f8d4d3869d6f0d7d94264012.zip
chromium_src-e93d2823ba7df0b5f8d4d3869d6f0d7d94264012.tar.gz
chromium_src-e93d2823ba7df0b5f8d4d3869d6f0d7d94264012.tar.bz2
Porting in the download manager (plus tiny bits of cleanup).
Review URL: http://codereview.chromium.org/19697 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_manager.cc')
-rw-r--r--chrome/browser/download/download_manager.cc28
1 files changed, 12 insertions, 16 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index fde5103..9ac3099 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <time.h>
-
#include "chrome/browser/download/download_manager.h"
#include "base/file_util.h"
@@ -41,9 +39,6 @@
#include "generated_resources.h"
-using base::Time;
-using base::TimeDelta;
-
// Periodically update our observers.
class DownloadItemUpdateTask : public Task {
public:
@@ -131,7 +126,7 @@ DownloadItem::DownloadItem(int32 download_id,
int path_uniquifier,
const std::wstring& url,
const FilePath& original_name,
- const Time start_time,
+ const base::Time start_time,
int64 download_size,
int render_process_id,
int request_id,
@@ -229,7 +224,7 @@ void DownloadItem::Remove(bool delete_on_disk) {
}
void DownloadItem::StartProgressTimer() {
- update_timer_.Start(TimeDelta::FromMilliseconds(kUpdateTimeMs), this,
+ update_timer_.Start(base::TimeDelta::FromMilliseconds(kUpdateTimeMs), this,
&DownloadItem::UpdateObservers);
}
@@ -237,7 +232,7 @@ void DownloadItem::StopProgressTimer() {
update_timer_.Stop();
}
-bool DownloadItem::TimeRemaining(TimeDelta* remaining) const {
+bool DownloadItem::TimeRemaining(base::TimeDelta* remaining) const {
if (total_bytes_ <= 0)
return false; // We never received the content_length for this download.
@@ -246,7 +241,7 @@ bool DownloadItem::TimeRemaining(TimeDelta* remaining) const {
return false;
*remaining =
- TimeDelta::FromSeconds((total_bytes_ - received_bytes_) / speed);
+ base::TimeDelta::FromSeconds((total_bytes_ - received_bytes_) / speed);
return true;
}
@@ -723,8 +718,9 @@ void DownloadManager::RemoveDownloadFromHistory(DownloadItem* download) {
hs->RemoveDownload(download->db_handle());
}
-void DownloadManager::RemoveDownloadsFromHistoryBetween(const Time remove_begin,
- const Time remove_end) {
+void DownloadManager::RemoveDownloadsFromHistoryBetween(
+ const base::Time remove_begin,
+ const base::Time remove_end) {
// FIXME(paulg) see bug 958058. EXPLICIT_ACCESS below is wrong.
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (hs)
@@ -982,8 +978,8 @@ void DownloadManager::RemoveDownload(int64 download_handle) {
delete download;
}
-int DownloadManager::RemoveDownloadsBetween(const Time remove_begin,
- const Time remove_end) {
+int DownloadManager::RemoveDownloadsBetween(const base::Time remove_begin,
+ const base::Time remove_end) {
RemoveDownloadsFromHistoryBetween(remove_begin, remove_end);
int num_deleted = 0;
@@ -1019,8 +1015,8 @@ int DownloadManager::RemoveDownloadsBetween(const Time remove_begin,
return num_deleted;
}
-int DownloadManager::RemoveDownloads(const Time remove_begin) {
- return RemoveDownloadsBetween(remove_begin, Time());
+int DownloadManager::RemoveDownloads(const base::Time remove_begin) {
+ return RemoveDownloadsBetween(remove_begin, base::Time());
}
// Initiate a download of a specific URL. We send the request to the
@@ -1152,7 +1148,7 @@ void DownloadManager::ShowDownloadInShell(const DownloadItem* download) {
}
void DownloadManager::OpenDownloadInShell(const DownloadItem* download,
- HWND parent_window) {
+ gfx::NativeView parent_window) {
DCHECK(file_manager_);
file_loop_->PostTask(FROM_HERE,
NewRunnableMethod(file_manager_,