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

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

Issue 7294013: Modified cancel and interrupt processing to avoid race with history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to TOT. Again :-}. Created 9 years, 5 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 void ActiveDownloadsHandler::HandleAllowDownload(const ListValue* args) { 267 void ActiveDownloadsHandler::HandleAllowDownload(const ListValue* args) {
268 DownloadItem* item = GetDownloadById(args); 268 DownloadItem* item = GetDownloadById(args);
269 if (item) 269 if (item)
270 item->DangerousDownloadValidated(); 270 item->DangerousDownloadValidated();
271 } 271 }
272 272
273 void ActiveDownloadsHandler::HandleCancelDownload(const ListValue* args) { 273 void ActiveDownloadsHandler::HandleCancelDownload(const ListValue* args) {
274 DownloadItem* item = GetDownloadById(args); 274 DownloadItem* item = GetDownloadById(args);
275 if (item) { 275 if (item) {
276 if (item->IsPartialDownload()) 276 if (item->IsPartialDownload())
277 item->Cancel(true); 277 item->Cancel();
278 item->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 278 item->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
279 } 279 }
280 } 280 }
281 281
282 bool ActiveDownloadsHandler::SelectTab(const GURL& url) { 282 bool ActiveDownloadsHandler::SelectTab(const GURL& url) {
283 for (TabContentsIterator it; !it.done(); ++it) { 283 for (TabContentsIterator it; !it.done(); ++it) {
284 TabContents* tab_contents = it->tab_contents(); 284 TabContents* tab_contents = it->tab_contents();
285 if (tab_contents->GetURL() == url) { 285 if (tab_contents->GetURL() == url) {
286 static_cast<RenderViewHostDelegate*>(tab_contents)->Activate(); 286 static_cast<RenderViewHostDelegate*>(tab_contents)->Activate();
287 return true; 287 return true;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 return (*it); 433 return (*it);
434 } 434 }
435 } 435 }
436 } 436 }
437 return NULL; 437 return NULL;
438 } 438 }
439 439
440 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const { 440 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const {
441 return handler_->downloads(); 441 return handler_->downloads();
442 } 442 }
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