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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 void ActiveDownloadsHandler::HandleCancelDownload(const ListValue* args) { | 243 void ActiveDownloadsHandler::HandleCancelDownload(const ListValue* args) { |
244 DownloadItem* item = GetDownloadById(args); | 244 DownloadItem* item = GetDownloadById(args); |
245 if (item) { | 245 if (item) { |
246 if (item->IsPartialDownload()) | 246 if (item->IsPartialDownload()) |
247 item->Cancel(true); | 247 item->Cancel(true); |
248 item->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); | 248 item->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 void ActiveDownloadsHandler::HandleShowAllFiles(const ListValue* args) { | 252 void ActiveDownloadsHandler::HandleShowAllFiles(const ListValue* args) { |
253 FileManagerUtil::ViewFolder( | 253 file_manager_util::ViewFolder( |
254 DownloadPrefs::FromDownloadManager(download_manager_)->download_path()); | 254 DownloadPrefs::FromDownloadManager(download_manager_)->download_path()); |
255 } | 255 } |
256 | 256 |
257 bool ActiveDownloadsHandler::SelectTab(const GURL& url) { | 257 bool ActiveDownloadsHandler::SelectTab(const GURL& url) { |
258 for (TabContentsIterator it; !it.done(); ++it) { | 258 for (TabContentsIterator it; !it.done(); ++it) { |
259 TabContents* tab_contents = it->tab_contents(); | 259 TabContents* tab_contents = it->tab_contents(); |
260 if (tab_contents->GetURL() == url) { | 260 if (tab_contents->GetURL() == url) { |
261 static_cast<RenderViewHostDelegate*>(tab_contents)->Activate(); | 261 static_cast<RenderViewHostDelegate*>(tab_contents)->Activate(); |
262 return true; | 262 return true; |
263 } | 263 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 } | 439 } |
440 } | 440 } |
441 } | 441 } |
442 return NULL; | 442 return NULL; |
443 } | 443 } |
444 #endif // defined(TOUCH_UI) | 444 #endif // defined(TOUCH_UI) |
445 | 445 |
446 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const { | 446 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const { |
447 return handler_->downloads(); | 447 return handler_->downloads(); |
448 } | 448 } |
OLD | NEW |