OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |