summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 21:21:12 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 21:21:12 +0000
commitd41355e6f0576dc372a6047ffc8e6f0fdea0129d (patch)
tree559d0200951e69c1b904edeafd45f5edb53844c5 /chrome/browser/download
parentb4abd1f1c5973ba9877f6617549d72c1fde74595 (diff)
downloadchromium_src-d41355e6f0576dc372a6047ffc8e6f0fdea0129d.zip
chromium_src-d41355e6f0576dc372a6047ffc8e6f0fdea0129d.tar.gz
chromium_src-d41355e6f0576dc372a6047ffc8e6f0fdea0129d.tar.bz2
Cloned from 62030
Add a "Clear All" link to the downloads page. Fixes jankiness of the blue bar in the download page as it loads. Improve rendering time of the downloads page by chunking the number of download items to do before scheduling the timeout. BUG=9033 Review URL: http://codereview.chromium.org/62115 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_manager.cc7
-rw-r--r--chrome/browser/download/download_manager.h6
2 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 04c6aeb..8d65eba 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -1083,6 +1083,11 @@ int DownloadManager::RemoveDownloads(const base::Time remove_begin) {
return RemoveDownloadsBetween(remove_begin, base::Time());
}
+int DownloadManager::RemoveAllDownloads() {
+ // The null times make the date range unbounded.
+ return RemoveDownloadsBetween(base::Time(), base::Time());
+}
+
// Initiate a download of a specific URL. We send the request to the
// ResourceDispatcherHost, and let it send us responses like a regular
// download.
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index 5f73b22..378f2b4 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -355,6 +355,10 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
// deleted is returned back to the caller.
int RemoveDownloads(const base::Time remove_begin);
+ // Remove all downloads will delete all downloads. The number of downloads
+ // deleted is returned back to the caller.
+ int RemoveAllDownloads();
+
// Download the object at the URL. Used in cases such as "Save Link As..."
void DownloadUrl(const GURL& url,
const GURL& referrer,