| 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/download/chrome_download_manager_delegate.h" | 5 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 drive::DownloadHandler* drive_download_handler = | 363 drive::DownloadHandler* drive_download_handler = |
| 364 drive::DownloadHandler::GetForProfile(profile_); | 364 drive::DownloadHandler::GetForProfile(profile_); |
| 365 if (drive_download_handler && | 365 if (drive_download_handler && |
| 366 drive_download_handler->IsDriveDownload(download)) { | 366 drive_download_handler->IsDriveDownload(download)) { |
| 367 drive_download_handler->CheckForFileExistence(download, callback); | 367 drive_download_handler->CheckForFileExistence(download, callback); |
| 368 return; | 368 return; |
| 369 } | 369 } |
| 370 #endif | 370 #endif |
| 371 BrowserThread::PostTaskAndReplyWithResult( | 371 BrowserThread::PostTaskAndReplyWithResult( |
| 372 BrowserThread::FILE, FROM_HERE, | 372 BrowserThread::FILE, FROM_HERE, |
| 373 base::Bind(&file_util::PathExists, download->GetTargetFilePath()), | 373 base::Bind(&base::PathExists, download->GetTargetFilePath()), |
| 374 callback); | 374 callback); |
| 375 } | 375 } |
| 376 | 376 |
| 377 DownloadProtectionService* | 377 DownloadProtectionService* |
| 378 ChromeDownloadManagerDelegate::GetDownloadProtectionService() { | 378 ChromeDownloadManagerDelegate::GetDownloadProtectionService() { |
| 379 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 379 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 380 #if defined(FULL_SAFE_BROWSING) | 380 #if defined(FULL_SAFE_BROWSING) |
| 381 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); | 381 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); |
| 382 if (sb_service && sb_service->download_protection_service() && | 382 if (sb_service && sb_service->download_protection_service() && |
| 383 profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) { | 383 profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 528 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 529 source); | 529 source); |
| 530 | 530 |
| 531 scoped_refptr<extensions::CrxInstaller> installer = | 531 scoped_refptr<extensions::CrxInstaller> installer = |
| 532 content::Source<extensions::CrxInstaller>(source).ptr(); | 532 content::Source<extensions::CrxInstaller>(source).ptr(); |
| 533 content::DownloadOpenDelayedCallback callback = | 533 content::DownloadOpenDelayedCallback callback = |
| 534 crx_installers_[installer.get()]; | 534 crx_installers_[installer.get()]; |
| 535 crx_installers_.erase(installer.get()); | 535 crx_installers_.erase(installer.get()); |
| 536 callback.Run(installer->did_handle_successfully()); | 536 callback.Run(installer->did_handle_successfully()); |
| 537 } | 537 } |
| OLD | NEW |