| 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 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/download/download_service.h" | 27 #include "chrome/browser/download/download_service.h" |
| 28 #include "chrome/browser/download/download_service_factory.h" | 28 #include "chrome/browser/download/download_service_factory.h" |
| 29 #include "chrome/browser/download/download_target_determiner.h" | 29 #include "chrome/browser/download/download_target_determiner.h" |
| 30 #include "chrome/browser/download/download_util.h" | 30 #include "chrome/browser/download/download_util.h" |
| 31 #include "chrome/browser/download/save_package_file_picker.h" | 31 #include "chrome/browser/download/save_package_file_picker.h" |
| 32 #include "chrome/browser/extensions/api/downloads/downloads_api.h" | 32 #include "chrome/browser/extensions/api/downloads/downloads_api.h" |
| 33 #include "chrome/browser/extensions/crx_installer.h" | 33 #include "chrome/browser/extensions/crx_installer.h" |
| 34 #include "chrome/browser/platform_util.h" | 34 #include "chrome/browser/platform_util.h" |
| 35 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 36 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 37 #include "chrome/common/chrome_constants.h" |
| 37 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
| 38 #include "components/user_prefs/pref_registry_syncable.h" | 39 #include "components/user_prefs/pref_registry_syncable.h" |
| 39 #include "content/public/browser/download_item.h" | 40 #include "content/public/browser/download_item.h" |
| 40 #include "content/public/browser/download_manager.h" | 41 #include "content/public/browser/download_manager.h" |
| 41 #include "content/public/browser/notification_source.h" | 42 #include "content/public/browser/notification_source.h" |
| 42 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
| 43 | 44 |
| 44 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
| 45 #include "chrome/browser/chromeos/drive/download_handler.h" | 46 #include "chrome/browser/chromeos/drive/download_handler.h" |
| 46 #include "chrome/browser/chromeos/drive/file_system_util.h" | 47 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 drive_download_handler->CheckForFileExistence(download, callback); | 396 drive_download_handler->CheckForFileExistence(download, callback); |
| 396 return; | 397 return; |
| 397 } | 398 } |
| 398 #endif | 399 #endif |
| 399 BrowserThread::PostTaskAndReplyWithResult( | 400 BrowserThread::PostTaskAndReplyWithResult( |
| 400 BrowserThread::FILE, FROM_HERE, | 401 BrowserThread::FILE, FROM_HERE, |
| 401 base::Bind(&base::PathExists, download->GetTargetFilePath()), | 402 base::Bind(&base::PathExists, download->GetTargetFilePath()), |
| 402 callback); | 403 callback); |
| 403 } | 404 } |
| 404 | 405 |
| 406 std::string |
| 407 ChromeDownloadManagerDelegate::ApplicationClientIdForFileScanning() const { |
| 408 return std::string(chrome::kApplicationClientIDStringForAVScanning); |
| 409 } |
| 410 |
| 405 DownloadProtectionService* | 411 DownloadProtectionService* |
| 406 ChromeDownloadManagerDelegate::GetDownloadProtectionService() { | 412 ChromeDownloadManagerDelegate::GetDownloadProtectionService() { |
| 407 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 413 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 408 #if defined(FULL_SAFE_BROWSING) | 414 #if defined(FULL_SAFE_BROWSING) |
| 409 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); | 415 SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); |
| 410 if (sb_service && sb_service->download_protection_service() && | 416 if (sb_service && sb_service->download_protection_service() && |
| 411 profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) { | 417 profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) { |
| 412 return sb_service->download_protection_service(); | 418 return sb_service->download_protection_service(); |
| 413 } | 419 } |
| 414 #endif | 420 #endif |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 571 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 566 source); | 572 source); |
| 567 | 573 |
| 568 scoped_refptr<extensions::CrxInstaller> installer = | 574 scoped_refptr<extensions::CrxInstaller> installer = |
| 569 content::Source<extensions::CrxInstaller>(source).ptr(); | 575 content::Source<extensions::CrxInstaller>(source).ptr(); |
| 570 content::DownloadOpenDelayedCallback callback = | 576 content::DownloadOpenDelayedCallback callback = |
| 571 crx_installers_[installer.get()]; | 577 crx_installers_[installer.get()]; |
| 572 crx_installers_.erase(installer.get()); | 578 crx_installers_.erase(installer.get()); |
| 573 callback.Run(installer->did_handle_successfully()); | 579 callback.Run(installer->did_handle_successfully()); |
| 574 } | 580 } |
| OLD | NEW |