OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 // If this is an incognito downloader, clear All should clear main download | 335 // If this is an incognito downloader, clear All should clear main download |
336 // manager as well. | 336 // manager as well. |
337 if (original_profile_download_manager_) | 337 if (original_profile_download_manager_) |
338 original_profile_download_manager_->RemoveAllDownloads(); | 338 original_profile_download_manager_->RemoveAllDownloads(); |
339 } | 339 } |
340 | 340 |
341 void DownloadsDOMHandler::HandleOpenDownloadsFolder(const ListValue* args) { | 341 void DownloadsDOMHandler::HandleOpenDownloadsFolder(const ListValue* args) { |
342 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_OPEN_FOLDER); | 342 CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_OPEN_FOLDER); |
343 platform_util::OpenItem( | 343 platform_util::OpenItem( |
344 DownloadPrefs::FromDownloadManager(download_manager_)->download_path()); | 344 DownloadPrefs::FromDownloadManager(download_manager_)->DownloadPath()); |
345 } | 345 } |
346 | 346 |
347 // DownloadsDOMHandler, private: ---------------------------------------------- | 347 // DownloadsDOMHandler, private: ---------------------------------------------- |
348 | 348 |
349 void DownloadsDOMHandler::SendCurrentDownloads() { | 349 void DownloadsDOMHandler::SendCurrentDownloads() { |
350 ListValue results_value; | 350 ListValue results_value; |
351 for (OrderedDownloads::iterator it = download_items_.begin(); | 351 for (OrderedDownloads::iterator it = download_items_.begin(); |
352 it != download_items_.end(); ++it) { | 352 it != download_items_.end(); ++it) { |
353 if (!*it) | 353 if (!*it) |
354 continue; | 354 continue; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 404 } |
405 | 405 |
406 content::DownloadItem* DownloadsDOMHandler::GetDownloadByValue( | 406 content::DownloadItem* DownloadsDOMHandler::GetDownloadByValue( |
407 const ListValue* args) { | 407 const ListValue* args) { |
408 int id; | 408 int id; |
409 if (ExtractIntegerValue(args, &id)) { | 409 if (ExtractIntegerValue(args, &id)) { |
410 return GetDownloadById(id); | 410 return GetDownloadById(id); |
411 } | 411 } |
412 return NULL; | 412 return NULL; |
413 } | 413 } |
OLD | NEW |