| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/dom_ui/downloads_ui.h" | 5 #include "chrome/browser/dom_ui/downloads_ui.h" |
| 6 | 6 |
| 7 #include "base/gfx/png_encoder.h" | 7 #include "base/gfx/png_encoder.h" |
| 8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
| 9 #include "base/thread.h" | 9 #include "base/thread.h" |
| 10 #include "base/time_format.h" | 10 #include "base/time_format.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 ClearDownloadItems(); | 308 ClearDownloadItems(); |
| 309 download_manager_->GetDownloads(this, search_text_); | 309 download_manager_->GetDownloads(this, search_text_); |
| 310 } else { | 310 } else { |
| 311 SendCurrentDownloads(); | 311 SendCurrentDownloads(); |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 | 314 |
| 315 void DownloadsDOMHandler::HandleOpenFile(const Value* value) { | 315 void DownloadsDOMHandler::HandleOpenFile(const Value* value) { |
| 316 DownloadItem* file = GetDownloadByValue(value); | 316 DownloadItem* file = GetDownloadByValue(value); |
| 317 if (file) | 317 if (file) |
| 318 download_manager_->OpenDownloadInShell(file, NULL); | 318 download_manager_->OpenDownload(file, NULL); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void DownloadsDOMHandler::HandleDrag(const Value* value) { | 321 void DownloadsDOMHandler::HandleDrag(const Value* value) { |
| 322 DownloadItem* file = GetDownloadByValue(value); | 322 DownloadItem* file = GetDownloadByValue(value); |
| 323 if (file) { | 323 if (file) { |
| 324 IconManager* im = g_browser_process->icon_manager(); | 324 IconManager* im = g_browser_process->icon_manager(); |
| 325 SkBitmap* icon = im->LookupIcon(file->full_path().ToWStringHack(), | 325 SkBitmap* icon = im->LookupIcon(file->full_path().ToWStringHack(), |
| 326 IconLoader::NORMAL); | 326 IconLoader::NORMAL); |
| 327 download_util::DragDownload(file, icon); | 327 download_util::DragDownload(file, icon); |
| 328 } | 328 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 handler->Init(); | 504 handler->Init(); |
| 505 | 505 |
| 506 DownloadsUIHTMLSource* html_source = new DownloadsUIHTMLSource(); | 506 DownloadsUIHTMLSource* html_source = new DownloadsUIHTMLSource(); |
| 507 | 507 |
| 508 // Set up the chrome-ui://downloads/ source. | 508 // Set up the chrome-ui://downloads/ source. |
| 509 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 509 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 510 NewRunnableMethod(&chrome_url_data_manager, | 510 NewRunnableMethod(&chrome_url_data_manager, |
| 511 &ChromeURLDataManager::AddDataSource, | 511 &ChromeURLDataManager::AddDataSource, |
| 512 html_source)); | 512 html_source)); |
| 513 } | 513 } |
| OLD | NEW |