Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/browser/ui/webui/downloads_dom_handler.cc

Issue 7796014: Make cancel remove cancelled download from active queues at time of cancel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix to try to get past main waterfall failure. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/webui/downloads_dom_handler.h" 5 #include "chrome/browser/ui/webui/downloads_dom_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // TODO(rdsmith): Change to DCHECK when http://crbug.com/84508 is fixed. 307 // TODO(rdsmith): Change to DCHECK when http://crbug.com/84508 is fixed.
308 CHECK_NE(DownloadItem::kUninitializedHandle, file->db_handle()); 308 CHECK_NE(DownloadItem::kUninitializedHandle, file->db_handle());
309 file->Remove(); 309 file->Remove();
310 } 310 }
311 } 311 }
312 312
313 void DownloadsDOMHandler::HandleCancel(const ListValue* args) { 313 void DownloadsDOMHandler::HandleCancel(const ListValue* args) {
314 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_CANCEL); 314 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_CANCEL);
315 DownloadItem* file = GetDownloadByValue(args); 315 DownloadItem* file = GetDownloadByValue(args);
316 if (file) 316 if (file)
317 file->Cancel(true); 317 file->Cancel();
318 } 318 }
319 319
320 void DownloadsDOMHandler::HandleClearAll(const ListValue* args) { 320 void DownloadsDOMHandler::HandleClearAll(const ListValue* args) {
321 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_CLEAR_ALL); 321 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_CLEAR_ALL);
322 download_manager_->RemoveAllDownloads(); 322 download_manager_->RemoveAllDownloads();
323 323
324 Profile* profile = 324 Profile* profile =
325 Profile::FromBrowserContext(download_manager_->browser_context()); 325 Profile::FromBrowserContext(download_manager_->browser_context());
326 // If this is an incognito downloader, clear All should clear main download 326 // If this is an incognito downloader, clear All should clear main download
327 // manager as well. 327 // manager as well.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 return NULL; 383 return NULL;
384 } 384 }
385 385
386 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) { 386 DownloadItem* DownloadsDOMHandler::GetDownloadByValue(const ListValue* args) {
387 int id; 387 int id;
388 if (ExtractIntegerValue(args, &id)) { 388 if (ExtractIntegerValue(args, &id)) {
389 return GetDownloadById(id); 389 return GetDownloadById(id);
390 } 390 }
391 return NULL; 391 return NULL;
392 } 392 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc ('k') | chrome/test/data/download-dangerous.jar » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698