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

Side by Side Diff: chrome/browser/ui/webui/active_downloads_ui.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/active_downloads_ui.h" 5 #include "chrome/browser/ui/webui/active_downloads_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 void ActiveDownloadsHandler::HandleAllowDownload(const ListValue* args) { 263 void ActiveDownloadsHandler::HandleAllowDownload(const ListValue* args) {
264 DownloadItem* item = GetDownloadById(args); 264 DownloadItem* item = GetDownloadById(args);
265 if (item) 265 if (item)
266 item->DangerousDownloadValidated(); 266 item->DangerousDownloadValidated();
267 } 267 }
268 268
269 void ActiveDownloadsHandler::HandleCancelDownload(const ListValue* args) { 269 void ActiveDownloadsHandler::HandleCancelDownload(const ListValue* args) {
270 DownloadItem* item = GetDownloadById(args); 270 DownloadItem* item = GetDownloadById(args);
271 if (item) { 271 if (item) {
272 if (item->IsPartialDownload()) 272 if (item->IsPartialDownload())
273 item->Cancel(true); 273 item->Cancel();
274 item->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 274 item->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
275 } 275 }
276 } 276 }
277 277
278 bool ActiveDownloadsHandler::SelectTab(const GURL& url) { 278 bool ActiveDownloadsHandler::SelectTab(const GURL& url) {
279 for (TabContentsIterator it; !it.done(); ++it) { 279 for (TabContentsIterator it; !it.done(); ++it) {
280 TabContents* tab_contents = it->tab_contents(); 280 TabContents* tab_contents = it->tab_contents();
281 if (tab_contents->GetURL() == url) { 281 if (tab_contents->GetURL() == url) {
282 static_cast<RenderViewHostDelegate*>(tab_contents)->Activate(); 282 static_cast<RenderViewHostDelegate*>(tab_contents)->Activate();
283 return true; 283 return true;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 } 459 }
460 } 460 }
461 return NULL; 461 return NULL;
462 } 462 }
463 #endif // defined(TOUCH_UI) 463 #endif // defined(TOUCH_UI)
464 464
465 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const { 465 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const {
466 return handler_->downloads(); 466 return handler_->downloads();
467 } 467 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698